B_EncodeDigestInfo
308 RSA BSAFE Crypto-C Library Reference Manual
B_EncodeDigestInfo
Description
B_EncodeDigestInfo encodes the DER encoding of a PKCS #1 DigestInfo type,
writing the encoding to
digestInfo
, which is a buffer supplied by the caller of at least
maxDigestInfoLen
bytes, and sets
digestInfoLen
to the length of the encoding.
algorithmID
points to an ITEM that gives the DER encoding of the message digest
algorithm. The ITEM type is defined by the KI_Item key info type in Chapter 3.
Typically,
algorithmID
is the value of
info
returned by calling B_GetAlgorithmInfo.
digest
points to the message digest value of length
digestLen
. Typically,
digest
is
returned by B_DigestFinal.
Return value
int B_EncodeDigestInfo (
unsigned char *digestInfo, /* encoded output buffer */
unsigned int *digestInfoLen, /* length of encoded output */
unsigned int maxDigestInfoLen, /* size of digestInfo buffer */
ITEM *algorithmID, /* message digest algorithm identifier */
unsigned char *digest, /* message digest value */
unsigned int digestLen /* length of digest */
);
Value Description
0 Operation was successful.
non-zero see Appendix A, ”Crypto-C Error Types”