|EVP_PKEY_NEW(3)||Library Functions Manual||EVP_PKEY_NEW(3)|
private key allocation functions
ENGINE *e, const unsigned char
*key, int keylen);
The EVP_PKEY structure is used by various OpenSSL functions which require a general private key without reference to any particular algorithm.
EVP_PKEY_new() function allocates an
empty EVP_PKEY structure. The reference count is set
to 1. To add a private or public key to it, use the functions described in
EVP_PKEY_up_ref() increments the reference
count of key by 1.
EVP_PKEY_free() decrements the reference
count of key by 1, and if the reference count reaches
zero, frees it up. If key is a
NULL pointer, no action occurs.
EVP_PKEY_new_mac_key() allocates a new
EVP_PKEY. If e is
NULL, then the new
EVP_PKEY structure is associated with the engine
e. The type argument indicates
what kind of key this is. The value should be a NID for a public key
algorithm that supports raw private keys, for example
EVP_PKEY_HMAC. key points to
the raw private key data for this EVP_PKEY which
should be of length keylen. The length should be
appropriate for the type of the key. The public key data will be
automatically derived from the given private key data (if appropriate for
the algorithm type).
EVP_PKEY_new_mac_key() return either the newly
allocated EVP_PKEY structure or
NULL if an error occurred.
EVP_PKEY_up_ref() returns 1 for success or
0 for failure.
EVP_PKEY_free() first appeared in SSLeay 0.6.0 and
have been available since OpenBSD 2.4.
EVP_PKEY_new_mac_key() first appeared in
OpenSSL 1.0.0 and has been available since OpenBSD
EVP_PKEY_up_ref() first appeared in
OpenSSL 1.1.0 and has been available since OpenBSD
|June 7, 2019||OpenBSD-current|