Derive a shared secret using a context initialized with EVP_PKEY_derive_init().

Synopsis

Declared in <openssl/evp.h>

int
EVP_PKEY_derive(
    EVP_PKEY_CTX* ctx,
    unsigned char* key,
    size_t* keylen);

Return Value

1 on success, or 0 / a negative value on failure.

Parameters

Name

Description

ctx

Key derivation context that already has a peer key configured when required.

key

Output buffer for the shared secret, or NULL to query the required length.

keylen

On input, size of key; on output, number of bytes written or required.

Created with MrDocs