Create a PKCS#7 signed‐data structure, with library context and property query.

Synopsis

Declared in <openssl/pkcs7.h>

PKCS7*
PKCS7_sign_ex(
    X509* signcert,
    EVP_PKEY* pkey,
    stack_st_X509* certs,
    BIO* data,
    int flags,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

New PKCS7, or NULL on error; free with PKCS7_free.

Parameters

Name

Description

signcert

Signer certificate, or NULL when only adding certs/flags require it.

pkey

Private key corresponding to signcert, or NULL for deferred signing.

certs

Optional additional certificates to include, or NULL.

data

BIO supplying the content to sign when not using detached/streaming flags.

flags

PKCS7_* flags controlling detached content, streaming, and attributes.

libctx

Library context for algorithm fetches, or NULL for the default.

propq

Property query for algorithm fetches, or NULL.

Created with MrDocs