EVP_PKEY_get_raw_public_key

Export the raw public key bytes of pkey into pub.

Synopsis

Declared in <openssl/evp.h>

int
EVP_PKEY_get_raw_public_key(
    EVP_PKEY const* pkey,
    unsigned char* pub,
    size_t* len);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
pkeyKey whose public material is exported (algorithm-dependent format).
pubOutput buffer, or NULL to only query the required length via len.
lenOn entry, capacity of pub when non-NULL; on return, number of bytes written or required.