CMS_add1_signer

Add a signer certificate and private key to a CMS SignedData ContentInfo.

Synopsis

Declared in <openssl/cms.h>

CMS_SignerInfo*
CMS_add1_signer(
    CMS_ContentInfo* cms,
    X509* signer,
    EVP_PKEY* pk,
    EVP_MD const* md,
    unsigned int flags);

Description

Unless CMS_REUSE_DIGEST is set, the ContentInfo is incomplete until finalized by streaming or CMS_final().

Return Value

The new CMS_SignerInfo on success, or NULL on error.

Parameters

NameDescription
cmsCMS_ContentInfo that must already be SignedData (for example from CMS_sign() with CMS_PARTIAL).
signerSigner certificate.
pkPrivate key corresponding to signer.
mdMessage digest to use, or NULL to select the default digest for the key algorithm.
flagsCMS_* option flags controlling digest reuse, attributes, and finalization.