CMS_SharedInfo_encode

DER-encode a CMS SharedInfo structure used in key-encryption key derivation.

Synopsis

Declared in <openssl/cms.h>

int
CMS_SharedInfo_encode(
    unsigned char** pder,
    X509_ALGOR* kekalg,
    ASN1_OCTET_STRING* ukm,
    int keylen);

Return Value

Length of the DER encoding, or a negative value on error.

Parameters

NameDescription
pderReceives a newly allocated DER encoding on success; free with OPENSSL_free.
kekalgKey-encryption algorithm identifier placed in SharedInfo.
ukmOptional user keying material OCTET STRING, or NULL.
keylenLength in bytes of the KEK being derived (encoded as a 4-byte INTEGER).