|
Leancrypto 1.7.2
Post-Quantum Cryptographic Library
|
Include dependency graph for lc_x509_common.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | lc_tm |
Functions | |
| int | lc_x509_sig_type_to_name (enum lc_sig_types pkey_algo, const char **alg) |
| Convert a leancrypto public key algorithm reference into human readable form. More... | |
| int | lc_x509_sig_type_to_hash (enum lc_sig_types pkey_algo, const struct lc_hash **hash_algo) |
| Obtain the hash type to be used with a given public key algorithm. More... | |
| int | lc_x509_oid_to_hash (enum OID oid, const struct lc_hash **hash_algo) |
| Obtain the hash type to be used with a given OID. More... | |
| enum OID | lc_look_up_OID (const uint8_t *data, size_t datasize) |
| Convert a binary representation of an OID to leancrypto internal reference. More... | |
| int | lc_gmtime (time64_t timeval, struct lc_tm *tm) |
| Trivial conversion of time to human-readable time value. More... | |
| int | lc_OID_to_data (enum OID oid, const uint8_t **data, size_t *datalen) |
| Conversion of OID to binary representation using an internal lookup table. More... | |
| int | lc_asn1_ber_encoder (const struct lc_asn1_encoder *encoder, void *context, uint8_t *data, size_t *in_out_avail_datalen) |
| ASN.1 encoder with 10 level hierarchy. More... | |
| int | lc_asn1_ber_encoder_small (const struct lc_asn1_encoder *encoder, void *context, uint8_t *data, size_t *in_out_avail_datalen) |
| ASN.1 encoder with 4 level hierarchy defined on stack. More... | |
| int | lc_asn1_ber_decoder (const struct lc_asn1_decoder *decoder, void *context, const uint8_t *data, size_t datalen) |
| Decoder BER/DER/CER ASN.1 according to pattern. More... | |
| struct lc_tm |
Definition at line 429 of file lc_x509_common.h.
| Data Fields | ||
|---|---|---|
| unsigned char | day | |
| unsigned char | hour | |
| unsigned char | min | |
| unsigned char | month | |
| unsigned char | sec | |
| unsigned short | year | |
| int lc_asn1_ber_decoder | ( | const struct lc_asn1_decoder * | decoder, |
| void * | context, | ||
| const uint8_t * | data, | ||
| size_t | datalen | ||
| ) |
Decoder BER/DER/CER ASN.1 according to pattern.
| [in] | decoder | The decoder definition (produced by asn1_compiler) |
| [in] | context | The caller's context (to be passed to the action functions) |
| [in] | data | The encoded data |
| [in] | datalen | The size of the encoded data |
Decode BER/DER/CER encoded ASN.1 data according to a bytecode pattern produced by asn1_compiler. Action functions are called on marked tags to allow the caller to retrieve significant data.
LIMITATIONS:
To keep down the amount of stack used by this function, the following limits have been imposed:
(1) This won't handle datalen > 65535 without increasing the size of the cons stack elements and length_too_long checking.
(2) The stack of constructed types is 10 deep. If the depth of non-leaf constructed types exceeds this, the decode will fail.
(3) The SET type (not the SET OF type) isn't really supported as tracking what members of the set have been seen is a pain.
| int lc_asn1_ber_encoder | ( | const struct lc_asn1_encoder * | encoder, |
| void * | context, | ||
| uint8_t * | data, | ||
| size_t * | in_out_avail_datalen | ||
| ) |
ASN.1 encoder with 10 level hierarchy.
See asn1_encoder_impl.h for details.
| [in] | encoder | Encoder definition |
| [in] | context | Arbitrary data handed to the decoding functions |
| [out] | data | Encoded data |
| [in,out] | in_out_avail_datalen | Length of the encoded data |
| int lc_asn1_ber_encoder_small | ( | const struct lc_asn1_encoder * | encoder, |
| void * | context, | ||
| uint8_t * | data, | ||
| size_t * | in_out_avail_datalen | ||
| ) |
ASN.1 encoder with 4 level hierarchy defined on stack.
See asn1_encoder_impl.h for details.
| [in] | encoder | Encoder definition |
| [in] | context | Arbitrary data handed to the decoding functions |
| [out] | data | Encoded data |
| [in,out] | in_out_avail_datalen | Length of the encoded data |
| int lc_gmtime | ( | time64_t | timeval, |
| struct lc_tm * | tm | ||
| ) |
Trivial conversion of time to human-readable time value.
It only shows UTC considering that Epoch is UTC (i.e. it does not apply any time-zone conversions).
Furthermore, it does not apply leap seconds.
| [in] | timeval | Time in seconds since Epoch |
| [out] | tm | Decoded time |
| enum OID lc_look_up_OID | ( | const uint8_t * | data, |
| size_t | datasize | ||
| ) |
Convert a binary representation of an OID to leancrypto internal reference.
| [in] | data | Binary OID data |
| [in] | datasize | Length of data buffer |
| int lc_OID_to_data | ( | enum OID | oid, |
| const uint8_t ** | data, | ||
| size_t * | datalen | ||
| ) |
Conversion of OID to binary representation using an internal lookup table.
| [in] | oid | OID reference to convert |
| [out] | data | Pointer to binary representation (reference into a leancrypto-internal database) |
| [out] | datalen | Length of the binary representation |
Obtain the hash type to be used with a given OID.
| [in] | oid | OID to convert |
| [out] | hash_algo | Hash reference (or NULL if none is to be used) |
| int lc_x509_sig_type_to_hash | ( | enum lc_sig_types | pkey_algo, |
| const struct lc_hash ** | hash_algo | ||
| ) |
Obtain the hash type to be used with a given public key algorithm.
| [in] | pkey_algo | public key algorithm type |
| [out] | hash_algo | Hash reference (or NULL if none is to be used) |
| int lc_x509_sig_type_to_name | ( | enum lc_sig_types | pkey_algo, |
| const char ** | alg | ||
| ) |
Convert a leancrypto public key algorithm reference into human readable form.
| [in] | pkey_algo | public key algorithm type |
| [out] | alg | Algorithm string |