CMS_sign

Create a CMS SignedData structure with the default library context.

Synopsis

Declared in <openssl/cms.h>

CMS_ContentInfo*
CMS_sign(
    X509* signcert,
    EVP_PKEY* pkey,
    stack_st_X509* certs,
    BIO* data,
    unsigned int flags);

Return Value

New SignedData ContentInfo, or NULL on error.

Parameters

NameDescription
signcertSigner certificate corresponding to pkey, or NULL for certificates-only.
pkeySigner private key, or NULL when only embedding certificates.
certsOptional intermediate certificates to include, or NULL.
dataContent BIO to sign.
flagsCMS signing flags (for example CMS_DETACHED, CMS_BINARY).