Perform key encapsulation: produce a wrapped key and a shared secret.

Synopsis

Declared in <openssl/evp.h>

int
EVP_PKEY_encapsulate(
    EVP_PKEY_CTX* ctx,
    unsigned char* wrappedkey,
    size_t* wrappedkeylen,
    unsigned char* genkey,
    size_t* genkeylen);

Return Value

1 on success, or a non‐positive value on failure.

Parameters

Name

Description

ctx

Context previously initialized with EVP_PKEY_encapsulate_init().

wrappedkey

Buffer receiving the encapsulated key, or NULL to query lengths.

wrappedkeylen

In/out length of wrappedkey.

genkey

Buffer receiving the generated shared secret, or NULL to query lengths.

genkeylen

In/out length of genkey.

Created with MrDocs