80#define QSC_X509_EDDSA_SEED_SIZE 32U
86#define QSC_X509_EDDSA_PUBLIC_KEY_SIZE 32U
92#define QSC_X509_ML_DSA_44_PRIVATEKEY_SIZE 2560U
98#define QSC_X509_ML_DSA_65_PRIVATEKEY_SIZE 4032U
104#define QSC_X509_ML_DSA_87_PRIVATEKEY_SIZE 4896U
110#define QSC_X509_ML_KEM_512_PRIVATEKEY_SIZE 1632U
116#define QSC_X509_ML_KEM_768_PRIVATEKEY_SIZE 2400U
122#define QSC_X509_ML_KEM_1024_PRIVATEKEY_SIZE 3168U
124#ifndef QSC_X509_ML_DSA_44_PUBLICKEY_SIZE
129#define QSC_X509_ML_DSA_44_PUBLICKEY_SIZE 1312U
132#ifndef QSC_X509_ML_DSA_65_PUBLICKEY_SIZE
137#define QSC_X509_ML_DSA_65_PUBLICKEY_SIZE 1952U
140#ifndef QSC_X509_ML_DSA_87_PUBLICKEY_SIZE
145#define QSC_X509_ML_DSA_87_PUBLICKEY_SIZE 2592U
148#ifndef QSC_X509_ML_KEM_512_PUBLICKEY_SIZE
153#define QSC_X509_ML_KEM_512_PUBLICKEY_SIZE 800U
156#ifndef QSC_X509_ML_KEM_768_PUBLICKEY_SIZE
161#define QSC_X509_ML_KEM_768_PUBLICKEY_SIZE 1184U
164#ifndef QSC_X509_ML_KEM_1024_PUBLICKEY_SIZE
169#define QSC_X509_ML_KEM_1024_PUBLICKEY_SIZE 1568U
172QSC_CPLUSPLUS_ENABLED_START
182#define QSC_X509_PRIVATE_KEY_MAX QSC_X509_ML_DSA_87_PRIVATEKEY_SIZE
192#define QSC_X509_PRIVATE_KEY_PUBLIC_MAX QSC_X509_SPKI_MAX
315QSC_EXPORT_API size_t qsc_x509_private_key_expected_private_size(
const qsc_x509_algorithm_identifier* algorithm);
356 uint8_t* privatekey,
size_t privatekeycapacity,
size_t* privatekeylen,
357 uint8_t* publickey,
size_t publickeycapacity,
size_t* publickeylen,
bool* publickeypresent);
383 uint8_t* privatekey,
size_t privatekeycapacity,
size_t* privatekeylen,
384 uint8_t* publickey,
size_t publickeycapacity,
size_t* publickeylen,
bool* publickeypresent);
400QSC_CPLUSPLUS_ENABLED_END
enum qsc_asn1_status_t qsc_asn1_status
ASN.1 helper status codes.
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition qsccommon.h:645
uint8_t publickey[QSC_X509_PRIVATE_KEY_PUBLIC_MAX]
Definition x509key.h:209
qsc_x509_algorithm_identifier algorithm
Definition x509key.h:206
size_t privatekeylen
Definition x509key.h:208
bool publickey_present
Definition x509key.h:211
size_t publickeylen
Definition x509key.h:210
uint8_t privatekey[QSC_X509_PRIVATE_KEY_MAX]
Definition x509key.h:207
A decoded private key object with optional embedded public key material.
QSC_EXPORT_API qsc_asn1_status qsc_x509_private_key_decode_sec1_pem(const char *pem, size_t pemlen, qsc_x509_private_key *key)
Decode a SEC 1 PEM private key.
Definition x509key.c:1049
QSC_EXPORT_API qsc_asn1_status qsc_x509_private_key_validate(const qsc_x509_private_key *key)
Get the expected private key size for an algorithm identifier.
Definition x509key.c:732
QSC_EXPORT_API qsc_asn1_status qsc_x509_private_key_decode_pkcs8_der(const uint8_t *data, size_t datalen, qsc_x509_private_key *key)
Decode a PKCS #8 DER private key.
Definition x509key.c:1068
QSC_EXPORT_API size_t qsc_x509_private_key_expected_public_size(const qsc_x509_algorithm_identifier *algorithm)
Get the expected public key size for an algorithm identifier.
Definition x509key.c:829
QSC_EXPORT_API qsc_asn1_status qsc_x509_private_key_decode_sec1_der(const uint8_t *data, size_t datalen, qsc_x509_private_key *key)
Decode a SEC 1 DER private key.
Definition x509key.c:1004
#define QSC_X509_PRIVATE_KEY_PUBLIC_MAX
The maximum supported embedded public key length in bytes.
Definition x509key.h:192
QSC_EXPORT_API void qsc_x509_private_key_initialize(qsc_x509_private_key *key)
Initialize a private-key container.
Definition x509key.c:994
QSC_EXPORT_API qsc_asn1_status qsc_x509_private_key_decode_pkcs8_pem_ex(const char *pem, size_t pemlen, qsc_x509_algorithm_identifier *algorithm, uint8_t *privatekey, size_t privatekeycapacity, size_t *privatekeylen, uint8_t *publickey, size_t publickeycapacity, size_t *publickeylen, bool *publickeypresent)
Decode a PKCS #8 PEM private key into caller-supplied buffers.
Definition x509key.c:947
QSC_EXPORT_API qsc_asn1_status qsc_x509_private_key_decode_pkcs8_der_ex(const uint8_t *data, size_t datalen, qsc_x509_algorithm_identifier *algorithm, uint8_t *privatekey, size_t privatekeycapacity, size_t *privatekeylen, uint8_t *publickey, size_t publickeycapacity, size_t *publickeylen, bool *publickeypresent)
Decode a PKCS #8 DER private key into caller-supplied buffers.
Definition x509key.c:890
QSC_EXPORT_API bool qsc_x509_certificate_key_match(const qsc_x509_certificate *certificate, const qsc_x509_private_key *key)
Test whether a certificate matches a private key object.
Definition x509key.c:1127
QSC_EXPORT_API qsc_asn1_status qsc_x509_private_key_decode_pkcs8_pem(const char *pem, size_t pemlen, qsc_x509_private_key *key)
Decode a PKCS #8 PEM private key.
Definition x509key.c:1108