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

The RFC 7250 RawPublicKey credential a TLS 1.3 Certificate message carries. More...

#include "protocore_config.h"

Go to the source code of this file.

Classes

struct  Tls13RpkNs
 Dispatch table. Addressed by offset, so the layout is asserted below. More...
 

Macros

#define PROTOCORE_TLS13_ED25519_SPKI_LEN   44
 DER SubjectPublicKeyInfo for an Ed25519 key (RFC 8410 sec 4)
 

Functions

 PROTOCORE_NS_LAYOUT (Tls13RpkNs, ed25519_spki, ed25519_from_spki, build_certificate)
 
size_t protocore_tls13_rpk_ed25519_spki (uint8_t *work, uint8_t *out, size_t cap, const uint8_t *pub)
 Write the 44-byte DER SubjectPublicKeyInfo for the Ed25519 key pub .
 
proto_bool protocore_tls13_rpk_ed25519_from_spki (uint8_t *work, const uint8_t *spki, size_t len, const uint8_t **pub)
 The 32-byte Ed25519 key inside a DER SubjectPublicKeyInfo (RFC 8410 .
 
size_t protocore_tls13_rpk_build_certificate (uint8_t *work, uint8_t *out, size_t cap, const uint8_t *ed25519_pub)
 Build a Certificate message (RFC 8446 sec 4.4.2) carrying an RFC .
 

Variables

PROTOCORE_NS Tls13RpkNs Tls13Rpk PROTOCORE_UNUSED
 Module namespace.
 

Detailed Description

The RFC 7250 RawPublicKey credential a TLS 1.3 Certificate message carries.

A RawPublicKey Certificate carries a bare DER SubjectPublicKeyInfo where an X.509 chain would go (RFC 7250 sec 3). This module is that credential: the Ed25519 SubjectPublicKeyInfo of RFC 8410 sec 4 in both directions, and the Certificate message built over it. The messages themselves, the server_certificate_type extension that selects this credential, and the handshake that negotiates it are tls13_msg's.

work is bytes the CALLER holds. This module reads none of them: it carries nothing between calls, so there is no state to keep and nothing to wipe. The parameter is there so a caller drives every namespace the same way.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file tls13_rpk.h.

Macro Definition Documentation

◆ PROTOCORE_TLS13_ED25519_SPKI_LEN

#define PROTOCORE_TLS13_ED25519_SPKI_LEN   44

DER SubjectPublicKeyInfo for an Ed25519 key (RFC 8410 sec 4)

Definition at line 33 of file tls13_rpk.h.

Function Documentation

◆ PROTOCORE_NS_LAYOUT()

PROTOCORE_NS_LAYOUT ( Tls13RpkNs  ,
ed25519_spki  ,
ed25519_from_spki  ,
build_certificate   
)

◆ protocore_tls13_rpk_ed25519_spki()

size_t protocore_tls13_rpk_ed25519_spki ( uint8_t *  work,
uint8_t *  out,
size_t  cap,
const uint8_t *  pub 
)

Write the 44-byte DER SubjectPublicKeyInfo for the Ed25519 key pub .

Parameters
workPROTOCORE_TLS13_RPK_BORROW bytes the caller took. Not held past the call.
outOut
capCap
pub32 bytes
Returns
The size_t.

◆ protocore_tls13_rpk_ed25519_from_spki()

proto_bool protocore_tls13_rpk_ed25519_from_spki ( uint8_t *  work,
const uint8_t *  spki,
size_t  len,
const uint8_t **  pub 
)

The 32-byte Ed25519 key inside a DER SubjectPublicKeyInfo (RFC 8410 .

Parameters
workPROTOCORE_TLS13_RPK_BORROW bytes the caller took. Not held past the call.
spkiSpki
lenLen
pubPub
Returns
PROTO_TRUE on success.

◆ protocore_tls13_rpk_build_certificate()

size_t protocore_tls13_rpk_build_certificate ( uint8_t *  work,
uint8_t *  out,
size_t  cap,
const uint8_t *  ed25519_pub 
)

Build a Certificate message (RFC 8446 sec 4.4.2) carrying an RFC .

Parameters
workPROTOCORE_TLS13_RPK_BORROW bytes the caller took. Not held past the call.
outOut
capCap
ed25519_pub32 bytes
Returns
The size_t.

Variable Documentation

◆ PROTOCORE_UNUSED

PROTOCORE_NS Tls13RpkNs Tls13Rpk PROTOCORE_UNUSED
Initial value:
size_t protocore_tls13_rpk_build_certificate(uint8_t *work, uint8_t *out, size_t cap, const uint8_t *ed25519_pub)
Build a Certificate message (RFC 8446 sec 4.4.2) carrying an RFC .
size_t protocore_tls13_rpk_ed25519_spki(uint8_t *work, uint8_t *out, size_t cap, const uint8_t *pub)
Write the 44-byte DER SubjectPublicKeyInfo for the Ed25519 key pub .
proto_bool protocore_tls13_rpk_ed25519_from_spki(uint8_t *work, const uint8_t *spki, size_t len, const uint8_t **pub)
The 32-byte Ed25519 key inside a DER SubjectPublicKeyInfo (RFC 8410 .

Module namespace.

Definition at line 73 of file tls13_rpk.h.