libressl-ASN1_item_digest3
Der-encode and hash an asn.1 value
Usage
Crypto Library (libcrypto, -lcrypto)
#include <openssl/x509.h>
int
ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *val_in, unsigned char *md, unsigned int *s);
Overview
ASN1_item_digest() assumes that val_in is an ASN1_VALUE of the type specified by it, encodes it into DER format by calling ASN1_item_i2d(3), hashes the resulting byte array using the digest type by calling EVP_Digest(3), places the digest value into *md, and, unless s is NULL, places the length in bytes of the digest into *s. Providing a buffer *md large enough to contain the digest is the responsibility of the caller; providing a buffer of EVP_MAX_MD_SIZE bytes is recommended.
Return values
ASN1_item_digest() returns 1 for success or 0 if encoding or hashing fails.