
|
My Project
|
Functions | |
| int | wc_PKCS7_InitWithCert (PKCS7 *pkcs7, byte *cert, word32 certSz) |
| This function initializes a PKCS7 structure with a DER-formatted certificate. To initialize an empty PKCS7 structure, one can pass in a NULL cert and 0 for certSz. More... | |
| void | wc_PKCS7_Free (PKCS7 *pkcs7) |
| This function releases any memory allocated by a PKCS7 initializer. More... | |
| int | wc_PKCS7_EncodeData (PKCS7 *pkcs7, byte *output, word32 outputSz) |
| This function builds the PKCS7 data content type, encoding the PKCS7 structure into a buffer containing a parsable PKCS7 data packet. More... | |
| int | wc_PKCS7_EncodeSignedData (PKCS7 *pkcs7, byte *output, word32 outputSz) |
| This function builds the PKCS7 signed data content type, encoding the PKCS7 structure into a buffer containing a parsable PKCS7 signed data packet. More... | |
| int | wc_PKCS7_EncodeSignedData_ex (PKCS7 *pkcs7, const byte *hashBuf, word32 hashSz, byte *outputHead, word32 *outputHeadSz, byte *outputFoot, word32 *outputFootSz) |
| This function builds the PKCS7 signed data content type, encoding the PKCS7 structure into a header and footer buffer containing a parsable PKCS7 signed data packet. This does not include the content. A hash must be computed and provided for the data. More... | |
| int | wc_PKCS7_VerifySignedData (PKCS7 *pkcs7, byte *pkiMsg, word32 pkiMsgSz) |
| This function takes in a transmitted PKCS7 signed data message, extracts the certificate list and certificate revocation list, and then verifies the signature. It stores the extracted content in the given PKCS7 structure. More... | |
| int | wc_PKCS7_VerifySignedData_ex (PKCS7 *pkcs7, const byte *hashBuf, word32 hashSz, byte *pkiMsgHead, word32 pkiMsgHeadSz, byte *pkiMsgFoot, word32 pkiMsgFootSz) |
| This function takes in a transmitted PKCS7 signed data message as hash/header/footer, then extracts the certificate list and certificate revocation list, and then verifies the signature. It stores the extracted content in the given PKCS7 structure. More... | |
| int | wc_PKCS7_EncodeEnvelopedData (PKCS7 *pkcs7, byte *output, word32 outputSz) |
| This function builds the PKCS7 enveloped data content type, encoding the PKCS7 structure into a buffer containing a parsable PKCS7 enveloped data packet. More... | |
| int | wc_PKCS7_DecodeEnvelopedData (PKCS7 *pkcs7, byte *pkiMsg, word32 pkiMsgSz, byte *output, word32 outputSz) |
| This function unwraps and decrypts a PKCS7 enveloped data content type, decoding the message into output. It uses the private key of the PKCS7 object passed in to decrypt the message. More... | |
| int wc_PKCS7_DecodeEnvelopedData | ( | PKCS7 * | pkcs7, |
| byte * | pkiMsg, | ||
| word32 | pkiMsgSz, | ||
| byte * | output, | ||
| word32 | outputSz | ||
| ) |
This function unwraps and decrypts a PKCS7 enveloped data content type, decoding the message into output. It uses the private key of the PKCS7 object passed in to decrypt the message.
| pkcs7 | pointer to the PKCS7 structure containing the private key with which to decode the enveloped data package |
| pkiMsg | pointer to the buffer containing the enveloped data package |
| pkiMsgSz | size of the enveloped data package |
| output | pointer to the buffer in which to store the decoded message |
| outputSz | size available in the output buffer |
Example
| int wc_PKCS7_EncodeData | ( | PKCS7 * | pkcs7, |
| byte * | output, | ||
| word32 | outputSz | ||
| ) |
This function builds the PKCS7 data content type, encoding the PKCS7 structure into a buffer containing a parsable PKCS7 data packet.
| pkcs7 | pointer to the PKCS7 structure to encode |
| output | pointer to the buffer in which to store the encoded certificate |
| outputSz | size available in the output buffer |
Example
| int wc_PKCS7_EncodeEnvelopedData | ( | PKCS7 * | pkcs7, |
| byte * | output, | ||
| word32 | outputSz | ||
| ) |
This function builds the PKCS7 enveloped data content type, encoding the PKCS7 structure into a buffer containing a parsable PKCS7 enveloped data packet.
| pkcs7 | pointer to the PKCS7 structure to encode |
| output | pointer to the buffer in which to store the encoded certificate |
| outputSz | size available in the output buffer |
Example
| int wc_PKCS7_EncodeSignedData | ( | PKCS7 * | pkcs7, |
| byte * | output, | ||
| word32 | outputSz | ||
| ) |
This function builds the PKCS7 signed data content type, encoding the PKCS7 structure into a buffer containing a parsable PKCS7 signed data packet.
| pkcs7 | pointer to the PKCS7 structure to encode |
| output | pointer to the buffer in which to store the encoded certificate |
| outputSz | size available in the output buffer |
Example
| int wc_PKCS7_EncodeSignedData_ex | ( | PKCS7 * | pkcs7, |
| const byte * | hashBuf, | ||
| word32 | hashSz, | ||
| byte * | outputHead, | ||
| word32 * | outputHeadSz, | ||
| byte * | outputFoot, | ||
| word32 * | outputFootSz | ||
| ) |
This function builds the PKCS7 signed data content type, encoding the PKCS7 structure into a header and footer buffer containing a parsable PKCS7 signed data packet. This does not include the content. A hash must be computed and provided for the data.
| pkcs7 | pointer to the PKCS7 structure to encode |
| hashBuf | pointer to computed hash for the content data |
| hashSz | size of the digest |
| outputHead | pointer to the buffer in which to store the encoded certificate header |
| outputHeadSz | pointer populated with size of output header buffer and returns actual size |
| outputFoot | pointer to the buffer in which to store the encoded certificate footer |
| outputFootSz | pointer populated with size of output footer buffer and returns actual size |
Example
| void wc_PKCS7_Free | ( | PKCS7 * | pkcs7 | ) |
This function releases any memory allocated by a PKCS7 initializer.
| pkcs7 | pointer to the PKCS7 structure to free |
Example
| int wc_PKCS7_InitWithCert | ( | PKCS7 * | pkcs7, |
| byte * | cert, | ||
| word32 | certSz | ||
| ) |
This function initializes a PKCS7 structure with a DER-formatted certificate. To initialize an empty PKCS7 structure, one can pass in a NULL cert and 0 for certSz.
| pkcs7 | pointer to the PKCS7 structure in which to store the decoded cert |
| cert | pointer to a buffer containing a DER formatted ASN.1 certificate with which to initialize the PKCS7 structure |
| certSz | size of the certificate buffer |
Example
| int wc_PKCS7_VerifySignedData | ( | PKCS7 * | pkcs7, |
| byte * | pkiMsg, | ||
| word32 | pkiMsgSz | ||
| ) |
This function takes in a transmitted PKCS7 signed data message, extracts the certificate list and certificate revocation list, and then verifies the signature. It stores the extracted content in the given PKCS7 structure.
| pkcs7 | pointer to the PKCS7 structure in which to store the parsed certificates |
| pkiMsg | pointer to the buffer containing the signed message to verify and decode |
| pkiMsgSz | size of the signed message |
Example
| int wc_PKCS7_VerifySignedData_ex | ( | PKCS7 * | pkcs7, |
| const byte * | hashBuf, | ||
| word32 | hashSz, | ||
| byte * | pkiMsgHead, | ||
| word32 | pkiMsgHeadSz, | ||
| byte * | pkiMsgFoot, | ||
| word32 | pkiMsgFootSz | ||
| ) |
This function takes in a transmitted PKCS7 signed data message as hash/header/footer, then extracts the certificate list and certificate revocation list, and then verifies the signature. It stores the extracted content in the given PKCS7 structure.
| pkcs7 | pointer to the PKCS7 structure in which to store the parsed certificates |
| hashBuf | pointer to computed hash for the content data |
| hashSz | size of the digest |
| pkiMsgHead | pointer to the buffer containing the signed message header to verify and decode |
| pkiMsgHeadSz | size of the signed message header |
| pkiMsgFoot | pointer to the buffer containing the signed message footer to verify and decode |
| pkiMsgFootSz | size of the signed message footer |
Example