ASN1_item_sign_ex

Sign the DER encoding of data using it and write AlgorithmIdentifier(s) plus the signature.

Synopsis

Declared in <openssl/asn1.h>

int
ASN1_item_sign_ex(
    ASN1_ITEM const* it,
    X509_ALGOR* algor1,
    X509_ALGOR* algor2,
    ASN1_BIT_STRING* signature,
    void const* data,
    ASN1_OCTET_STRING const* id,
    EVP_PKEY* pkey,
    EVP_MD const* md,
    OSSL_LIB_CTX* libctx,
    char const* propq);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
itASN.1 item describing data.
algor1First AlgorithmIdentifier to fill (for example signatureAlgorithm), or NULL.
algor2Optional second AlgorithmIdentifier to fill, or NULL.
signatureBIT STRING that receives the signature bytes.
dataObject whose DER encoding is signed.
idOptional ASN.1 OCTET STRING identity / SM2-id parameter, or NULL.
pkeyPrivate key used to create the signature.
mdDigest method, or NULL to use the key-type default.
libctxLibrary context for algorithm fetches, or NULL for the default.
propqProperty query for algorithm fetches, or NULL.