EVP_PKEY_new_raw_private_key

Create an EVP_PKEY from raw private-key octets (legacy NID/ENGINE form).

Synopsis

Declared in <openssl/evp.h>

EVP_PKEY*
EVP_PKEY_new_raw_private_key(
    int type,
    ENGINE* e,
    unsigned char const* priv,
    size_t len);

Return Value

New EVP_PKEY, or NULL on failure; free with EVP_PKEY_free().

Parameters

NameDescription
typeKey type NID such as EVP_PKEY_X25519 or EVP_PKEY_ED25519.
eOptional ENGINE, or NULL (ignored for provider-only types).
privRaw private-key bytes in the algorithm-native format.
lenLength of priv in bytes.