OSSL_HPKE_CTX_set1_psk

Set the pre-shared key and PSK identifier for PSK / PSKAUTH modes.

Synopsis

Declared in <openssl/hpke.h>

int
OSSL_HPKE_CTX_set1_psk(
    OSSL_HPKE_CTX* ctx,
    char const* pskid,
    unsigned char const* psk,
    size_t psklen);

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
ctxHPKE context on sender or receiver (call before encap/decap).
pskidNUL-terminated PSK identity string (non-NULL when a PSK is used).
pskPSK bytes (non-NULL; length at least OSSL_HPKE_MIN_PSKLEN).
psklenLength of psk in bytes.