Skip to content

Commit b300a7d

Browse files
committed
feat: add pkix-pub and pkcs8-priv key codecs
Introduce container codecs for IETF-standard asymmetric key formats that carry the algorithm identifier alongside the key material, so implementers can reuse existing crypto libraries and specs rather than mint a per-algorithm codec for every new scheme. - pkix-pub (0x40): SubjectPublicKeyInfo (SPKI) per IETF RFC 5280 section 4.1.2.7 - pkcs8-priv (0x41): OneAsymmetricKey (PKCS #8) per IETF RFC 5958 section 2 - both formats self-identify the key algorithm via the embedded AlgorithmIdentifier OID - codes placed in the single-byte varint range (< 0x80) so existing users of libp2p-key (0x72) in peer IDs and IPNS names can migrate without paying an extra prefix byte per identifier - 0x40 and 0x41 sit in the unclustered 0x39-0x4f free block, avoiding the ipld/CID-codec neighborhood at 0x70-0x7f Refs: - https://www.rfc-editor.org/rfc/rfc5280 - https://www.rfc-editor.org/rfc/rfc5958 - libp2p/specs#711
1 parent c89cc36 commit b300a7d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

table.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ dns, multiaddr, 0x35, permanent,
3636
dns4, multiaddr, 0x36, permanent,
3737
dns6, multiaddr, 0x37, permanent,
3838
dnsaddr, multiaddr, 0x38, permanent,
39+
pkix-pub, key, 0x40, draft, DER-encoded ASN.1 type SubjectPublicKeyInfo (SPKI) according to IETF RFC 5280 section 4.1.2.7; public key algorithm identified by the embedded AlgorithmIdentifier OID
40+
pkcs8-priv, key, 0x41, draft, DER-encoded ASN.1 type OneAsymmetricKey (PKCS #8) according to IETF RFC 5958 section 2; private key algorithm identified by the embedded AlgorithmIdentifier OID
3941
protobuf, serialization, 0x50, draft, Protocol Buffers
4042
cbor, ipld, 0x51, permanent, CBOR
4143
raw, ipld, 0x55, permanent, raw binary

0 commit comments

Comments
 (0)