libressl-EVP_PKCS82PKEY3
Convert between evp_pkey and pkcs#8 privatekeyinfo
Usage
Crypto Library (libcrypto, -lcrypto)
#include <openssl/x509.h>
EVP_PKEY *
EVP_PKCS82PKEY(const PKCS8_PRIV_KEY_INFO *keyinfo);
PKCS8_PRIV_KEY_INFO *
EVP_PKEY2PKCS8(EVP_PKEY *pkey);
Overview
EVP_PKCS82PKEY() extracts the private key from a PKCS#8 PrivateKeyInfo structure.
EVP_PKEY2PKCS8() creates a PKCS#8 PrivateKeyInfo structure representing the private key contained in pkey.
Supported algorithms include DH, DSA, EC, and RSA.
Return values
These functions return a newly allocated object or NULL if the algorithm indicated in keyinfo or pkey is unsupported or if memory allocation, decoding, or encoding fails.