Sign the DER encoding of data using it and write AlgorithmIdentifier(s) plus the signature.
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);
1 on success, or 0 on failure.
| Name | Description |
|---|---|
| it | ASN.1 item describing data. |
| algor1 | First AlgorithmIdentifier to fill (for example signatureAlgorithm), or NULL. |
| algor2 | Optional second AlgorithmIdentifier to fill, or NULL. |
| signature | BIT STRING that receives the signature bytes. |
| data | Object whose DER encoding is signed. |
| id | Optional ASN.1 OCTET STRING identity / SM2-id parameter, or NULL. |
| pkey | Private key used to create the signature. |
| md | Digest method, or NULL to use the key-type default. |
| libctx | Library context for algorithm fetches, or NULL for the default. |
| propq | Property query for algorithm fetches, or NULL. |