EVP_SealInit

Initialize a seal (envelope encrypt) operation for npubk recipients.

Synopsis

Declared in <openssl/evp.h>

int
EVP_SealInit(
    EVP_CIPHER_CTX* ctx,
    EVP_CIPHER const* type,
    unsigned char** ek,
    int* ekl,
    unsigned char* iv,
    EVP_PKEY** pubk,
    int npubk);

Return Value

Number of recipients successfully processed, or 0 on failure.

Parameters

NameDescription
ctxCipher context that will encrypt the content with a generated session key.
typeSymmetric cipher used for the content.
ekArray of buffers receiving per-recipient encrypted session keys.
eklArray receiving the encrypted-key lengths written to ek.
ivBuffer receiving the generated IV (sized for type), or NULL if unused.
pubkArray of recipient public keys used to wrap the session key.
npubkNumber of entries in pubk / ek / ekl.