EVP_PKEY_new_raw_private_key_ex

Create an EVP_PKEY from raw private-key octets using a named algorithm and library context.

Synopsis

Declared in <openssl/evp.h>

EVP_PKEY*
EVP_PKEY_new_raw_private_key_ex(
    OSSL_LIB_CTX* libctx,
    char const* keytype,
    char const* propq,
    unsigned char const* priv,
    size_t len);

Return Value

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

Parameters

NameDescription
libctxLibrary context used to fetch the key type, or NULL for the default.
keytypeAlgorithm name such as "ED25519" or "X25519".
propqProperty query string, or NULL.
privRaw private-key bytes in the algorithm-native format.
lenLength of priv in bytes.