ASN1_sign

Sign ASN.1 data described by an i2d encoder using pkey (deprecated).

Synopsis

Declared in <openssl/x509.h>

[[deprecated]]
int
ASN1_sign(
    i2d_of_void* i2d,
    X509_ALGOR* algor1,
    X509_ALGOR* algor2,
    ASN1_BIT_STRING* signature,
    char* data,
    EVP_PKEY* pkey,
    EVP_MD const* type);

WARNING

Deprecated. Use of this entity is allowed but discouraged.

Return Value

  • Signature length in bytes on success, or 0 on failure.
  • Signature length in bytes on success, or 0 on failure.

Parameters

NameDescription
i2dEncoder that serializes data into DER for hashing.
algor1Optional AlgorithmIdentifier updated with the signature algorithm, or NULL.
algor2Optional second AlgorithmIdentifier updated similarly, or NULL.
signatureOutput BIT STRING that receives the signature bits.
dataStructure passed to i2d.
pkeyPrivate key used for signing.
typeDigest algorithm used to hash the DER encoding.