EVP_PKEY_get1_encoded_public_key

Allocate and return the encoded public-key octet string for pkey.

Synopsis

Declared in <openssl/evp.h>

size_t
EVP_PKEY_get1_encoded_public_key(
    EVP_PKEY* pkey,
    unsigned char** ppub);

Return Value

Length of the encoded public key in bytes, or 0 on failure.

Parameters

NameDescription
pkeyKey whose public key is exported.
ppubOn success, set to a newly allocated buffer holding the encoded public key; free with OPENSSL_free().