ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
x509_types.h File Reference

What a certificate SAYS, as types: the algorithm identifiers and the parsed view. More...

#include "protocore_config.h"

Go to the source code of this file.

Classes

struct  X509Bytes
 A run of the caller's bytes: where a field is, and how much of it there is. More...
 
struct  X509Cert
 

Macros

RFC 5280 sec 4.2.1.3 KeyUsage bits, in the order the BIT STRING numbers them.
#define PROTOCORE_X509_KU_DIGITAL_SIGNATURE   0x0001u
 
#define PROTOCORE_X509_KU_NON_REPUDIATION   0x0002u
 
#define PROTOCORE_X509_KU_KEY_ENCIPHERMENT   0x0004u
 
#define PROTOCORE_X509_KU_DATA_ENCIPHERMENT   0x0008u
 
#define PROTOCORE_X509_KU_KEY_AGREEMENT   0x0010u
 
#define PROTOCORE_X509_KU_KEY_CERT_SIGN   0x0020u
 
#define PROTOCORE_X509_KU_CRL_SIGN   0x0040u
 

Typedefs

typedef PROTOCORE_BEGIN_DECLS enum PROTO_ENUM_PACKED protocore_x509_sig_alg
 The signature algorithms this profile reads (RFC 5280 sec 4.1.1.2).
 
typedef enum PROTO_ENUM_PACKED protocore_x509_key_alg
 The public key algorithms this profile reads (RFC 5280 sec 4.1.2.7).
 

Enumerations

enum  PROTO_ENUM_PACKED {
  PROTOCORE_X509_SIG_UNKNOWN = 0 , PROTOCORE_X509_SIG_RSA_SHA256 , PROTOCORE_X509_SIG_RSA_SHA384 , PROTOCORE_X509_SIG_RSA_SHA512 ,
  PROTOCORE_X509_SIG_RSA_PSS , PROTOCORE_X509_SIG_ECDSA_SHA256 , PROTOCORE_X509_SIG_ECDSA_SHA384 , PROTOCORE_X509_SIG_ED25519 ,
  PROTOCORE_X509_KEY_UNKNOWN = 0 , PROTOCORE_X509_KEY_RSA , PROTOCORE_X509_KEY_EC_P256 , PROTOCORE_X509_KEY_ED25519
}
 The signature algorithms this profile reads (RFC 5280 sec 4.1.1.2). More...
 
enum  PROTO_ENUM_PACKED {
  PROTOCORE_X509_SIG_UNKNOWN = 0 , PROTOCORE_X509_SIG_RSA_SHA256 , PROTOCORE_X509_SIG_RSA_SHA384 , PROTOCORE_X509_SIG_RSA_SHA512 ,
  PROTOCORE_X509_SIG_RSA_PSS , PROTOCORE_X509_SIG_ECDSA_SHA256 , PROTOCORE_X509_SIG_ECDSA_SHA384 , PROTOCORE_X509_SIG_ED25519 ,
  PROTOCORE_X509_KEY_UNKNOWN = 0 , PROTOCORE_X509_KEY_RSA , PROTOCORE_X509_KEY_EC_P256 , PROTOCORE_X509_KEY_ED25519
}
 The public key algorithms this profile reads (RFC 5280 sec 4.1.2.7). More...
 

Detailed Description

What a certificate SAYS, as types: the algorithm identifiers and the parsed view.

Vocabulary, not behaviour - no state, no entries, nothing to link. It is a module of its own because two paths need the words and only one needs the parser: a TLS connection that authenticates by RFC 7250 raw public key still carries the peer's key in an X509Cert and still names a signature scheme as a protocore_x509_sig_alg, while the RFC 5280 DER parsing behind PROTOCORE_ENABLE_X509 is exactly what such a build does not compile.

A parsed certificate is a VIEW, not a copy: every X509Bytes here points into the caller's own encoding, which has to outlive the view.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file x509_types.h.

Macro Definition Documentation

◆ PROTOCORE_X509_KU_DIGITAL_SIGNATURE

#define PROTOCORE_X509_KU_DIGITAL_SIGNATURE   0x0001u

Definition at line 52 of file x509_types.h.

◆ PROTOCORE_X509_KU_NON_REPUDIATION

#define PROTOCORE_X509_KU_NON_REPUDIATION   0x0002u

Definition at line 53 of file x509_types.h.

◆ PROTOCORE_X509_KU_KEY_ENCIPHERMENT

#define PROTOCORE_X509_KU_KEY_ENCIPHERMENT   0x0004u

Definition at line 54 of file x509_types.h.

◆ PROTOCORE_X509_KU_DATA_ENCIPHERMENT

#define PROTOCORE_X509_KU_DATA_ENCIPHERMENT   0x0008u

Definition at line 55 of file x509_types.h.

◆ PROTOCORE_X509_KU_KEY_AGREEMENT

#define PROTOCORE_X509_KU_KEY_AGREEMENT   0x0010u

Definition at line 56 of file x509_types.h.

◆ PROTOCORE_X509_KU_KEY_CERT_SIGN

#define PROTOCORE_X509_KU_KEY_CERT_SIGN   0x0020u

Definition at line 57 of file x509_types.h.

◆ PROTOCORE_X509_KU_CRL_SIGN

#define PROTOCORE_X509_KU_CRL_SIGN   0x0040u

Definition at line 58 of file x509_types.h.

Typedef Documentation

◆ protocore_x509_sig_alg

The signature algorithms this profile reads (RFC 5280 sec 4.1.1.2).

◆ protocore_x509_key_alg

The public key algorithms this profile reads (RFC 5280 sec 4.1.2.7).

Enumeration Type Documentation

◆ PROTO_ENUM_PACKED [1/2]

The signature algorithms this profile reads (RFC 5280 sec 4.1.1.2).

Enumerator
PROTOCORE_X509_SIG_UNKNOWN 

an algorithm this build does not verify

PROTOCORE_X509_SIG_RSA_SHA256 

sha256WithRSAEncryption, {pkcs-1 11} (RFC 8017 A.2.4)

PROTOCORE_X509_SIG_RSA_SHA384 

sha384WithRSAEncryption, {pkcs-1 12}

PROTOCORE_X509_SIG_RSA_SHA512 

sha512WithRSAEncryption, {pkcs-1 13}

PROTOCORE_X509_SIG_RSA_PSS 

id-RSASSA-PSS, {pkcs-1 10}

PROTOCORE_X509_SIG_ECDSA_SHA256 

ecdsa-with-SHA256, 1.2.840.10045.4.3.2 (RFC 5480 sec 2.1.1)

PROTOCORE_X509_SIG_ECDSA_SHA384 

ecdsa-with-SHA384, 1.2.840.10045.4.3.3

PROTOCORE_X509_SIG_ED25519 

id-Ed25519, 1.3.101.112 (RFC 8410 sec 3)

PROTOCORE_X509_KEY_UNKNOWN 

an algorithm this build cannot use

PROTOCORE_X509_KEY_RSA 

rsaEncryption, {pkcs-1 1}

PROTOCORE_X509_KEY_EC_P256 

id-ecPublicKey over secp256r1 (RFC 5480 sec 2.1.1)

PROTOCORE_X509_KEY_ED25519 

id-Ed25519 (RFC 8410 sec 4)

Definition at line 29 of file x509_types.h.

◆ PROTO_ENUM_PACKED [2/2]

The public key algorithms this profile reads (RFC 5280 sec 4.1.2.7).

Enumerator
PROTOCORE_X509_SIG_UNKNOWN 

an algorithm this build does not verify

PROTOCORE_X509_SIG_RSA_SHA256 

sha256WithRSAEncryption, {pkcs-1 11} (RFC 8017 A.2.4)

PROTOCORE_X509_SIG_RSA_SHA384 

sha384WithRSAEncryption, {pkcs-1 12}

PROTOCORE_X509_SIG_RSA_SHA512 

sha512WithRSAEncryption, {pkcs-1 13}

PROTOCORE_X509_SIG_RSA_PSS 

id-RSASSA-PSS, {pkcs-1 10}

PROTOCORE_X509_SIG_ECDSA_SHA256 

ecdsa-with-SHA256, 1.2.840.10045.4.3.2 (RFC 5480 sec 2.1.1)

PROTOCORE_X509_SIG_ECDSA_SHA384 

ecdsa-with-SHA384, 1.2.840.10045.4.3.3

PROTOCORE_X509_SIG_ED25519 

id-Ed25519, 1.3.101.112 (RFC 8410 sec 3)

PROTOCORE_X509_KEY_UNKNOWN 

an algorithm this build cannot use

PROTOCORE_X509_KEY_RSA 

rsaEncryption, {pkcs-1 1}

PROTOCORE_X509_KEY_EC_P256 

id-ecPublicKey over secp256r1 (RFC 5480 sec 2.1.1)

PROTOCORE_X509_KEY_ED25519 

id-Ed25519 (RFC 8410 sec 4)

Definition at line 42 of file x509_types.h.