Expand description
RFC 9909 standard ASN.1 DER and PEM codecs for FIPS 205 SLH-DSA-SHAKE
SubjectPublicKeyInfo (SPKI) and PKCS#8 (OneAsymmetricKey / PrivateKeyInfo).
§Official NIST CSOR OIDs (RFC 9909)
SLH-DSA-SHAKE-128s:2.16.840.1.101.3.4.3.26(... 04 03 1A)SLH-DSA-SHAKE-128f:2.16.840.1.101.3.4.3.27(... 04 03 1B)SLH-DSA-SHAKE-192s:2.16.840.1.101.3.4.3.28(... 04 03 1C)SLH-DSA-SHAKE-192f:2.16.840.1.101.3.4.3.29(... 04 03 1D)SLH-DSA-SHAKE-256s:2.16.840.1.101.3.4.3.30(... 04 03 1E)SLH-DSA-SHAKE-256f:2.16.840.1.101.3.4.3.31(... 04 03 1F)
Per RFC 9909:
AlgorithmIdentifier.parametersMUST be absent (noNULL).SPKIcarries the raw2n-byte public key (PK.seed || PK.root) insideBIT STRING.PKCS#8carries the raw4n-byte private key (SK.seed || SK.prf || PK.seed || PK.root) insideprivateKey OCTET STRING.PKCS#8decoding strictly enforces RFC 5958OneAsymmetricKey:version0 MUST omit[1] publicKey, andversion1 MUST include[1] publicKey, which must equal thePK.seed || PK.rootembedded in the private key. Well-formed[0] attributesare accepted and ignored. Encoders emitversion0 without a public key.- Secret intermediates are held in zeroize-on-drop buffers, and private-key PEM uses constant-time base64.
Functions§
- decode_
pkcs8_ der - Decodes an RFC 9909 PKCS#8 DER private key while enforcing
policy. - decode_
pkcs8_ pem - Decodes an RFC 9909 PEM private key (
-----BEGIN PRIVATE KEY-----). - decode_
spki_ der - Decodes an RFC 9909 SPKI DER verifying key while enforcing
policy. - decode_
spki_ pem - Decodes an RFC 9909 PEM verifying key (
-----BEGIN PUBLIC KEY-----). - encode_
pkcs8_ der - Encodes an SLH-DSA
4n-byte private key into RFC 9909 PKCS#8 DER. - encode_
pkcs8_ pem - Encodes an SLH-DSA private key into RFC 9909 PEM (
-----BEGIN PRIVATE KEY-----). - encode_
spki_ der - Encodes an SLH-DSA verifying key into RFC 9909 SPKI DER.
- encode_
spki_ pem - Encodes an SLH-DSA verifying key into RFC 9909 PEM (
-----BEGIN PUBLIC KEY-----).