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

Name

Description

pder

Receives a newly allocated DER encoding on success; free with OPENSSL_free.

kekalg

Key‐encryption algorithm identifier placed in SharedInfo.

ukm

Optional user keying material OCTET STRING, or NULL.

keylen

Length in bytes of the KEK being derived (encoded as a 4‐byte INTEGER).

Created with MrDocs