Leancrypto 1.6.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_x509_common.h File Reference
#include "ext_headers.h"
#include "lc_asn1.h"
#include "lc_hash.h"
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.
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.
int lc_gmtime (time64_t timeval, struct lc_tm *tm)

Data Structure Documentation

◆ lc_tm

struct lc_tm

Definition at line 373 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

Function Documentation

◆ lc_gmtime()

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.

Parameters
[in]timevalTime in seconds since Epoch
[out]tmDecoded time
Returns
0 on success; < 0 on error

◆ lc_x509_sig_type_to_hash()

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.

Parameters
[in]pkey_algopublic key algorithm type
[out]hash_algoHash reference (or NULL if none is to be used)
Returns
0 on success, < 0 on error

◆ lc_x509_sig_type_to_name()

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.

Parameters
[in]pkey_algopublic key algorithm type
[out]algAlgorithm string
Returns
0 on success, < 0 on error