ASN1_item_sign

Sign the DER encoding of an ASN.1 value described by it.

Synopsis

Declared in <openssl/x509.h>

int
ASN1_item_sign(
    ASN1_ITEM const* it,
    X509_ALGOR* algor1,
    X509_ALGOR* algor2,
    ASN1_BIT_STRING* signature,
    void const* data,
    EVP_PKEY* pkey,
    EVP_MD const* md);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
itASN.1 item descriptor for data.
algor1Optional AlgorithmIdentifier to set for the signature algorithm, or NULL.
algor2Optional second AlgorithmIdentifier to set (for example in certificates), or NULL.
signatureDestination BIT STRING that receives the signature bits.
dataObject to encode with it and sign.
pkeyPrivate key used for signing.
mdMessage digest, or NULL to use a key-type default where applicable.