B_EncodeDigestInfo

B_EncodeDigestInfo

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 */

);

 

 

 

 

 

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

Value

Description

0

Operation was successful.

non-zero

see Appendix A, ”Crypto-C Error Types”

 

 

3 0 8

R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l

Page 318
Image 318
RSA Security 5 manual Int BEncodeDigestInfo