|
Leancrypto 1.7.2
Post-Quantum Cryptographic Library
|
Functions | |
| int | lc_pkcs8_encode (const struct lc_pkcs8_message *pkcs8, uint8_t *data, size_t *avail_datalen) |
| Encode a PKCS#8 message. More... | |
Concept of PKCS#8 message generation handling in leancrypto
The leancrypto library provides an PKCS#8 generator which can create PKCS#8 messages. The generator does not enforce any PKCS#8 limitations and thus allows the caller to generate any combination of field offered by the PKCS#8 specification. To appropriately use the PKCS#8 parser, please consider the following rules:
lc_pkcs8_message data structure (e.g. on stack) and fill it with the numerous setter functions to add data.pkcs8_message data structure should be released at the end of the operation with lc_pkcs8_message_clear. | int lc_pkcs8_encode | ( | const struct lc_pkcs8_message * | pkcs8, |
| uint8_t * | data, | ||
| size_t * | avail_datalen | ||
| ) |
Encode a PKCS#8 message.
The function generates a PKCS#8 data blob from the filled PKCS#8 data structure.
The signature of the data using the signer is created within this call.
This API offers generation of PKCS#8 messages with:
| [in] | pkcs8 | The data structure that is filled by the caller before this invocation using the various setter functions. |
| [in,out] | data | Raw PKCS#8 data blob in DER / BER format - the caller must provide the memory |
| [in,out] | avail_datalen | Length of the raw PKCS#8 certificate buffer that is free (the input value must be equal to the data buffer size, the output refers to how many bytes are unused) |