QSC Post Quantum Cryptographic Library 1.1.0.2 (B2)
A post quantum secure library written in Ansi C
Loading...
Searching...
No Matches
x509crlwrite.h
Go to the documentation of this file.
1/* 2020-2026 Quantum Resistant Cryptographic Solutions Corporation
2 * All Rights Reserved.
3 *
4 * NOTICE:
5 * This software and all accompanying materials are the exclusive property of
6 * Quantum Resistant Cryptographic Solutions Corporation (QRCS). The intellectual
7 * and technical concepts contained herein are proprietary to QRCS and are
8 * protected under applicable Canadian, U.S., and international copyright,
9 * patent, and trade secret laws.
10 *
11 * CRYPTOGRAPHIC ALGORITHMS AND IMPLEMENTATIONS:
12 * - This software includes implementations of cryptographic primitives and
13 * algorithms that are standardized or in the public domain, such as AES
14 * and SHA-3, which are not proprietary to QRCS.
15 * - This software also includes cryptographic primitives, constructions, and
16 * algorithms designed by QRCS, including but not limited to RCS, SCB, CSX, QMAC, and
17 * related components, which are proprietary to QRCS.
18 * - All source code, implementations, protocol compositions, optimizations,
19 * parameter selections, and engineering work contained in this software are
20 * original works of QRCS and are protected under this license.
21 *
22 * LICENSE AND USE RESTRICTIONS:
23 * - This software is licensed under the Quantum Resistant Cryptographic Solutions
24 * Public Research and Evaluation License (QRCS-PREL), 2025-2026.
25 * - Permission is granted solely for non-commercial evaluation, academic research,
26 * cryptographic analysis, interoperability testing, and feasibility assessment.
27 * - Commercial use, production deployment, commercial redistribution, or
28 * integration into products or services is strictly prohibited without a
29 * separate written license agreement executed with QRCS.
30 * - Licensing and authorized distribution are solely at the discretion of QRCS.
31 *
32 * EXPERIMENTAL CRYPTOGRAPHY NOTICE:
33 * Portions of this software may include experimental, novel, or evolving
34 * cryptographic designs. Use of this software is entirely at the user's risk.
35 *
36 * DISCLAIMER:
37 * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38 * IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS
39 * FOR A PARTICULAR PURPOSE, SECURITY, OR NON-INFRINGEMENT. QRCS DISCLAIMS ALL
40 * LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
41 * ARISING FROM THE USE OR MISUSE OF THIS SOFTWARE.
42 *
43 * FULL LICENSE:
44 * This software is subject to the Quantum Resistant Cryptographic Solutions
45 * Public Research and Evaluation License (QRCS-PREL), 2025-2026. The complete license terms
46 * are provided in the accompanying LICENSE file or at https://www.qrcscorp.ca.
47 *
48 * Written by: John G. Underhill
49 * Contact: contact@qrcscorp.ca
50 */
51
52#ifndef QSC_X509_CRLWRITE_H
53#define QSC_X509_CRLWRITE_H
54
55#include "qsccommon.h"
56#include "x509crl.h"
57#include "x509types.h"
58
59QSC_CPLUSPLUS_ENABLED_START
60
75
84#define QSC_X509_CRL_WRITE_MAX 8192U
85
97{
98 uint32_t version;
99 qsc_x509_name issuer;
100 qsc_x509_validity validity;
101 qsc_x509_algorithm_identifier signaturealgorithm;
102 qsc_x509_extensions extensions;
104 size_t entrycount;
106
120
133
147
162
175QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_set_signature_algorithm(qsc_x509_crl_builder* builder, const qsc_x509_algorithm_identifier* signaturealgorithm);
176
189QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_validate_issuer(const qsc_x509_crl_builder* builder, const qsc_x509_certificate* issuer);
190
206QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_add_revoked_serial(qsc_x509_crl_builder* builder, const uint8_t* serialnumber, size_t serialnumberlen, const qsc_asn1_time* revocationdate);
207
222
237QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_encode_tbs_der(const qsc_x509_crl_builder* builder, uint8_t* output, size_t* outputlen);
238
255QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_sign(const qsc_x509_crl_builder* builder, qsc_x509_certificate_sign_callback signcallback, void* context, uint8_t* output, size_t* outputlen);
256
271QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_der_encode_pem(const uint8_t* der, size_t derlen, char* output, size_t* outputlen);
272
287QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_encode_pem(const qsc_x509_crl* crl, char* output, size_t* outputlen);
288
289QSC_CPLUSPLUS_ENABLED_END
290
291#endif
enum qsc_asn1_status_t qsc_asn1_status
ASN.1 helper status codes.
QSC_EXPORT_API struct qsc_asn1_time_t qsc_asn1_time
A normalized ASN.1 time representation.
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:605
Definition x509crlwrite.h:97
qsc_x509_validity validity
Definition x509crlwrite.h:100
size_t entrycount
Definition x509crlwrite.h:104
qsc_x509_name issuer
Definition x509crlwrite.h:99
qsc_x509_crl_entry entries[QSC_X509_CRL_REVOKED_MAX]
Definition x509crlwrite.h:103
qsc_x509_algorithm_identifier signaturealgorithm
Definition x509crlwrite.h:101
qsc_x509_extensions extensions
Definition x509crlwrite.h:102
uint32_t version
Definition x509crlwrite.h:98
A mutable certificate revocation list builder.
A decoded revoked-certificate entry from a CRL.
A decoded X.509 CertificateList object.
X.509 certificate revocation list parsing, encoding, lookup, and verification interface.
#define QSC_X509_CRL_REVOKED_MAX
The maximum number of revoked certificate entries retained in a decoded CRL.
Definition x509crl.h:96
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_set_signature_algorithm(qsc_x509_crl_builder *builder, const qsc_x509_algorithm_identifier *signaturealgorithm)
Set the CRL signature algorithm identifier.
Definition x509crlwrite.c:456
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_sign(const qsc_x509_crl_builder *builder, qsc_x509_certificate_sign_callback signcallback, void *context, uint8_t *output, size_t *outputlen)
Sign and encode a complete CRL.
Definition x509crlwrite.c:862
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_add_revoked_serial(qsc_x509_crl_builder *builder, const uint8_t *serialnumber, size_t serialnumberlen, const qsc_asn1_time *revocationdate)
Add a revoked certificate entry by serial number.
Definition x509crlwrite.c:605
QSC_EXPORT_API void qsc_x509_crl_builder_initialize(qsc_x509_crl_builder *builder)
Initialize a CRL builder.
Definition x509crlwrite.c:390
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_set_update_times(qsc_x509_crl_builder *builder, const qsc_asn1_time *thisupdate, const qsc_asn1_time *nextupdate)
Set the CRL update times.
Definition x509crlwrite.c:429
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_set_issuer(qsc_x509_crl_builder *builder, const qsc_x509_name *issuer)
Set the CRL issuer distinguished name.
Definition x509crlwrite.c:411
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_add_extension(qsc_x509_crl_builder *builder, const qsc_x509_extension *extension)
Add a CRL extension to the builder.
Definition x509crlwrite.c:670
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_encode_pem(const qsc_x509_crl *crl, char *output, size_t *outputlen)
Encode a decoded CRL object into PEM.
Definition x509crlwrite.c:963
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_validate_issuer(const qsc_x509_crl_builder *builder, const qsc_x509_certificate *issuer)
Validate the builder issuer against an issuer certificate.
Definition x509crlwrite.c:562
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_der_encode_pem(const uint8_t *der, size_t derlen, char *output, size_t *outputlen)
Encode a DER CRL into PEM.
Definition x509crlwrite.c:932
QSC_EXPORT_API qsc_asn1_status qsc_x509_crl_builder_encode_tbs_der(const qsc_x509_crl_builder *builder, uint8_t *output, size_t *outputlen)
Encode the TBSCertList portion as DER.
Definition x509crlwrite.c:723
QSC_EXPORT_API void qsc_x509_crl_builder_clear(qsc_x509_crl_builder *builder)
Clear a CRL builder.
Definition x509crlwrite.c:401