Generate an HPKE recipient key pair for suite, optionally from IKM.

Synopsis

Declared in <openssl/hpke.h>

int
OSSL_HPKE_keygen(
    OSSL_HPKE_SUITE suite,
    unsigned char* pub,
    size_t* publen,
    EVP_PKEY** priv,
    unsigned char const* ikm,
    size_t ikmlen,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

1 on success, or 0 on error.

Parameters

Name

Description

suite

Suite whose KEM determines the key type.

pub

Destination for the encoded public key; on input *`publen` is capacity.

publen

In/out public‐key length.

priv

Address of an EVP_PKEY* set to the new private key on success.

ikm

Optional input key material for deterministic generation, or NULL for random.

ikmlen

Length of ikm (0 when ikm is NULL); should be >= recommended IKM length.

libctx

Library context for algorithm fetches, or NULL for the default.

propq

Optional property query string, or NULL.

Created with MrDocs