UDIF: Universal Digital Identification Framework 1.1.0.0a (A1)
A quantum-secure cryptographic identification
certstore.h
Go to the documentation of this file.
1/* 2025-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 UDIF_CERTSTORE_H
53#define UDIF_CERTSTORE_H
54
55#include "certificate.h"
56
67
72#define UDIF_CERTSTORE_CAPACITY 256U
73
86
98
108
115
122
131
143
152UDIF_EXPORT_API const udif_certificate* udif_certstore_find(const udif_certstore* store, const uint8_t* serial);
153
163
174UDIF_EXPORT_API udif_errors udif_certstore_set_status(udif_certstore* store, const uint8_t* serial, udif_certstore_status status, uint64_t nowsecs);
175
185UDIF_EXPORT_API udif_errors udif_certstore_validate_status(udif_certstore* store, const uint8_t* serial, uint64_t nowsecs);
186
202UDIF_EXPORT_API udif_errors udif_certstore_verify_certificate(udif_certstore* store, const uint8_t* serial, uint64_t nowsecs);
203
204#endif
UDIF certificate operations.
UDIF_EXPORT_API udif_errors udif_certstore_add(udif_certstore *store, const udif_certificate *cert, udif_certstore_status status, uint64_t nowsecs)
Add or update a certificate status entry.
Definition certstore.c:232
UDIF_EXPORT_API udif_errors udif_certstore_set_status(udif_certstore *store, const uint8_t *serial, udif_certstore_status status, uint64_t nowsecs)
Set the status of an existing certificate serial.
Definition certstore.c:328
UDIF_EXPORT_API udif_certstore_status udif_certstore_get_status(const udif_certstore *store, const uint8_t *serial)
Return the stored status for a certificate serial.
Definition certstore.c:305
UDIF_EXPORT_API void udif_certstore_clear(udif_certstore *store)
Clear a certificate store.
Definition certstore.c:208
UDIF_EXPORT_API udif_errors udif_certstore_verify_certificate(udif_certstore *store, const uint8_t *serial, uint64_t nowsecs)
Verify a certificate recursively against the stored root chain and status.
Definition certstore.c:428
UDIF_EXPORT_API const udif_certificate * udif_certstore_find(const udif_certstore *store, const uint8_t *serial)
Find a certificate by serial number.
Definition certstore.c:282
udif_certstore_status
Runtime status assigned to a certificate serial.
Definition certstore.h:79
@ udif_certstore_status_suspended
Definition certstore.h:82
@ udif_certstore_status_active
Definition certstore.h:81
@ udif_certstore_status_expired
Definition certstore.h:84
@ udif_certstore_status_revoked
Definition certstore.h:83
@ udif_certstore_status_unknown
Definition certstore.h:80
#define UDIF_CERTSTORE_CAPACITY
Maximum number of certificate status records held by one context.
Definition certstore.h:72
UDIF_EXPORT_API size_t udif_certstore_count(const udif_certstore *store)
Return the number of occupied entries.
Definition certstore.c:218
UDIF_EXPORT_API udif_errors udif_certstore_validate_status(udif_certstore *store, const uint8_t *serial, uint64_t nowsecs)
Validate that a certificate serial is active at a specified time.
Definition certstore.c:371
UDIF_EXPORT_API void udif_certstore_initialize(udif_certstore *store)
Initialize a certificate store.
Definition certstore.c:198
UDIF entity certificate.
Definition certificate.h:341
Certificate status record.
Definition certstore.h:92
udif_certificate cert
Definition certstore.h:93
bool occupied
Definition certstore.h:96
uint64_t statustime
Definition certstore.h:95
udif_certstore_status status
Definition certstore.h:94
Fixed-capacity certificate status table.
Definition certstore.h:104
udif_certstore_entry entries[UDIF_CERTSTORE_CAPACITY]
Definition certstore.h:105
size_t count
Definition certstore.h:106
udif_errors
UDIF error codes.
Definition udif.h:1210
#define UDIF_EXPORT_API
The api export prefix.
Definition udifcommon.h:101