Files
skills/plugins/document-navigator/docs/security-stack/crypto/crypto-rsa/README.md
admin 9bf56a806b Move docs/ package mirror into document-navigator plugin
Relocate the ~6k-file docs tree from the repo root into
plugins/document-navigator/docs/ so the plugin is self-contained and
portable. docs/superpowers/ (specs and plans) stays at the repo root.

Moved via cp+rm rather than git mv because directory rename() fails with
EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the
identical-content files at commit time.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 01:10:00 +01:00

60 KiB

@suaveplan/crypto-rsa - RSA primitives — RFC 8017 PKCS #1 v2.2, RFC 5208 PKCS #8, RFC 5280 SPKI, RFC 7517/7518 JWK, RFC 7468 PEM. Universal; ships ASN.1/DER, key parse/serialise across PKCS#1/SPKI/PKCS#8/JWK/PEM, modulus-length policy, modular-arithmetic primitives, and the error/observability registry.

Summary

RSA primitives for Suaveplan — RFC 8017 PKCS #1 v2.2, RFC 5208 / RFC 5958 PKCS #8, RFC 5280 SPKI, RFC 7517 / RFC 7518 JWK, RFC 7468 PEM. Universal package (zero browser/React dependencies, runs anywhere ES2022 + BigInt + crypto.subtle or a @noble/curves-compatible engine is available).

This package is shipped in stages. Stage 1 (this release) provides every primitive a sign/verify/encrypt/decrypt pipeline depends on: ASN.1 / DER reader and writer, key parsing and serialisation across all five formats, modulus-length policy enforcement, modular-arithmetic primitives (modPow, i2osp, os2ip, CRT private operation), PEM textual encoding, and the full error / observability registry. Stages 2-4 will land the encoding methods (MGF1 + EMSA-PKCS1-v1_5 + EMSA-PSS), the sign / verify / encrypt / decrypt / key-generation entry points, the engine adapter (@noble/curves

  • WebCrypto subtle), and the FIPS / JWK / blinding / fingerprint surface.

Documentation tree

  • benchmarks — (no submodules)
  • rsa-2048-key — Real 2048-bit RSA keypair generated once at module-load time and exposed as canonical RsaPublicKey / RsaPrivateKey…
  • test-keys — Tiny synthetic RSA keypair for unit tests that need an RsaPrivateKey / RsaPublicKey shape but don't need to run a r…
  • reader — Strict-DER reader scoped to the RSA key shapes defined in RFC 8017 Appendix A (PKCS#1), RFC 5280 §4.1 + Appendix A (`Su…
  • writer — Strict-DER encoder mirroring asn1/reader. Encodes the same minimal subset of ASN.1 needed to serialise RSA keys in PK…
  • blinding — (no submodules)
  • oaep — RSAES-OAEP decryption per RFC 8017 §7.1.2 — counterpart to encrypt/oaep. Modern default for RSA public-key encryption.
  • pkcs1v15 — RSAES-PKCS1-v1_5 decryption per RFC 8017 §7.2.2. Counterpart to encrypt/pkcs1v15. Provides legacy interop for protoco…
  • emsa-pkcs1-v1_5 — Implements EMSA-PKCS1-v1_5-ENCODE from RFC 8017 §9.2 — the encoding method underlying RSASSA-PKCS1-v1_5 signatures. T…
  • emsa-pss-encode — Implements the EMSA-PSS encoding operation defined in RFC 8017 §9.1.1. Given a message digest, an encoded-message bit l…
  • emsa-pss-verify — Implements the EMSA-PSS verification operation defined in RFC 8017 §9.1.2. Given the message digest, the candidate enco…
  • mgf1 — Implements the MGF1 mask-generation function defined in RFC 8017 §B.2.1. MGF1 is the building block used by EMSA-PSS an…
  • default-rng — Single canonical adapter that lifts the crypto.getRandomValues CSPRNG into the @suaveplan/types Rng interface eve…
  • oaep — RSAES-OAEP encryption per RFC 8017 §7.1.1. The Optimal Asymmetric Encryption Padding (OAEP) scheme is the modern defaul…
  • pkcs1v15 — RSAES-PKCS1-v1_5 encryption per RFC 8017 §7.2.1 — the legacy public-key encryption padding scheme historically used by…
  • noble — Default RsaCryptoEngine backed by the pure-JS noble primitives this package ships natively. Provides the `name: "nobl…
  • select — Resolve the default RsaCryptoEngine for the host runtime. When globalThis.crypto.subtle exposes the RSA algorithms…
  • subtle — RsaCryptoEngine adapter over globalThis.crypto.subtle. When the host runtime exposes WebCrypto, this engine routes…
  • errors — (no submodules)
  • format — Render a fingerprint byte sequence as a human- and machine-readable string. Provides four output formats covering every…
  • spki — Compute a deterministic fingerprint of an RSA public key by hashing its SPKI DER encoding (RFC 5280 §4.1 `SubjectPublic…
  • registry — Process-wide registry for RSA key-handle providers. Every HSM, KMS, OS keychain, or PKCS#11 bridge registers a provider…
  • software — Reference RsaKeyHandleProvider wrapping in-memory RsaPrivateKey values. Implements the same interface as a real HSM…
  • thumbprint-uri — Compute the JWK Thumbprint URI per RFC 9278 §3 — the canonical `urn:ietf:params:oauth:jwk-thumbprint::<base64…
  • thumbprint — Compute the JWK Thumbprint of an RSA public key per RFC 7638 §3.2. The thumbprint is a deterministic hash over the cano…
  • exponent — Public-exponent validation for RSA key generation. The e-only constraints (odd, > 1, < 2^256) live here so they c…
  • generate — RSA key-pair generation per NIST FIPS 186-5 Appendix A.1 and SP 800-56B Rev. 2 §6.3. Two-prime by default; multi-prime…
  • miller-rabin — Probable-prime test per NIST FIPS 186-5 Appendix B.3.1, used by generateRsaKeyPair to qualify candidate primes during…
  • multi-prime — Multi-prime RSA key generation per RFC 8017 §3 and PKCS #1 Appendix A.1.2 OtherPrimeInfos extension. Reachable via th…
  • jwk-policy — Cross-check a JWK's key_ops, use, and alg members against the requested operation per RFC 7517 §4.2 / §4.3 / §4.4…
  • oid — Centralised OID constants for the RSA wire formats handled by this package. Currently exports OID_RSA_ENCRYPTION (`1.…
  • parse-jwk — Parses RSA JWKs per RFC 7517 §6.3.1 (public) and §6.3.2 (private). Accepts the JWK as a plain JS object literal, as a J…
  • parse-pkcs1-private — Parses a DER-encoded RSAPrivateKey per RFC 8017 Appendix A.1.2 into the canonical RsaPrivateKey shape with mandator…
  • parse-pkcs1-public — Parses a DER-encoded RSAPublicKey ::= SEQUENCE { modulus INTEGER, publicExponent INTEGER } per RFC 8017 Appendix A.1.…
  • parse-pkcs8 — Parses a PKCS#8 PrivateKeyInfo per RFC 5208 §5 — also accepts the RFC 5958 OneAsymmetricKey shape, which adds optio…
  • parse-spki — Parses an X.509 SubjectPublicKeyInfo per RFC 5280 §4.1 + Appendix A and unwraps the inner PKCS#1 RSAPublicKey. SPKI…
  • parse — Public dispatcher entry-point unifying the four key-format parsers (PKCS#1, SPKI, PKCS#8, JWK) under one ergonomic call…
  • serialize-jwk — Inverse of parseRsaPublicKeyJwk and parseRsaPrivateKeyJwk. Emits an RsaJwk with every numeric field encoded as ba…
  • serialize-pkcs1-private — Inverse of parseRsaPrivateKeyPkcs1. Emits a DER RSAPrivateKey SEQUENCE per RFC 8017 Appendix A.1.2 from a canonical…
  • serialize-pkcs1-public — Inverse of parseRsaPublicKeyPkcs1. Emits a DER RSAPublicKey SEQUENCE per RFC 8017 Appendix A.1.1 from a canonical `…
  • serialize-pkcs8 — Inverse of parseRsaPrivateKeyPkcs8. Wraps a serialised PKCS#1 RSAPrivateKey in a DER PrivateKeyInfo per RFC 5208…
  • serialize-spki — Inverse of parseRsaPublicKeySpki. Wraps a serialised PKCS#1 RSAPublicKey in a DER SubjectPublicKeyInfo per RFC 52…
  • serialize — Public dispatcher entry-point inverse of parse. Selects the per-format serialiser via the same format discriminator…
  • crt — RSA private-key operation via the Chinese Remainder Theorem (RFC 8017 §5.1.2, second-form algorithm). Computes `m = c^d…
  • i2osp — Integer-to-Octet-String Primitive (RFC 8017 §4.1). Encodes a non-negative integer as a fixed-length big-endian byte str…
  • modpow — Single-source-of-truth modular exponentiation for the entire @suaveplan/crypto-rsa package. Wraps `@noble/curves/abst…
  • os2ip — Octet-String-to-Integer Primitive (RFC 8017 §4.2). Decodes a big-endian byte string into a non-negative bigint. Used…
  • metrics — OpenTelemetry meter + instrument registry for @suaveplan/crypto-rsa. defines the full instrument set the prop…
  • timing — Centralised high-resolution clock source used by every metric histogram in @suaveplan/crypto-rsa. Resolves to `perfor…
  • labels — Centralised PEM textual labels per RFC 7468 §5/§10/§11 used by the public and private PEM parsers and serialisers in th…
  • parse-private — Parse an RSA private key from RFC 7468 PEM textual encoding. Accepts the two canonical private-key armor labels — `"PRI…
  • parse-public — Parse an RSA public key from RFC 7468 PEM textual encoding. Accepts both canonical armor labels — "PUBLIC KEY" (SPKI…
  • pem-codec — Underlying RFC 7468 textual-encoding codec used by the four PEM parse/serialise entry points in this module. Splits the…
  • serialize-private — Inverse of parseRsaPrivateKeyPem. Emits PEM textual encoding for an RSA private key in either PKCS#8 ("PRIVATE KEY"…
  • serialize-public — Inverse of parseRsaPublicKeyPem. Emits PEM textual encoding for an RSA public key in either SPKI ("PUBLIC KEY", the…
  • policy — (no submodules)
  • profile — (no submodules)
  • schemas — (no submodules)
  • pkcs1v15 — RSASSA-PKCS1-v1_5 signature generation per RFC 8017 §8.2.1. Hashes the message with the configured algorithm, applies…
  • pss — RSASSA-PSS signature generation per RFC 8017 §8.1.1. Hashes the message, draws a random salt of the configured length,…
  • pkcs1v15 — RSASSA-PKCS1-v1_5 signature verification per RFC 8017 §8.2.2. Recovers the encoded message from signature via `s^e m…
  • pss — RSASSA-PSS signature verification per RFC 8017 §8.1.2. Recovers the encoded message via s^e mod n, then runs the EMSA…
+ [blinded_vs_unblinded_2048](./src/__benchmarks__/blinded_vs_unblinded_2048.md) — _(no submodules)_+ [rsa-2048-key](./src/__fixtures__/rsa-2048-key.md) — Real 2048-bit RSA keypair generated once at module-load time and exposed as canonical `RsaPublicKey` / `RsaPrivateKey`…
  • test-keys — Tiny synthetic RSA keypair for unit tests that need an RsaPrivateKey / RsaPublicKey shape but don't need to run a r…
  • reader — Strict-DER reader scoped to the RSA key shapes defined in RFC 8017 Appendix A (PKCS#1), RFC 5280 §4.1 + Appendix A (`Su…
  • writer — Strict-DER encoder mirroring asn1/reader. Encodes the same minimal subset of ASN.1 needed to serialise RSA keys in PK…
  • blinding — (no submodules)+ blinding — (no submodules)+ oaep — RSAES-OAEP decryption per RFC 8017 §7.1.2 — counterpart to encrypt/oaep. Modern default for RSA public-key encryption.
  • pkcs1v15 — RSAES-PKCS1-v1_5 decryption per RFC 8017 §7.2.2. Counterpart to encrypt/pkcs1v15. Provides legacy interop for protoco…
  • emsa-pkcs1-v1_5 — Implements EMSA-PKCS1-v1_5-ENCODE from RFC 8017 §9.2 — the encoding method underlying RSASSA-PKCS1-v1_5 signatures. T…
  • emsa-pss-encode — Implements the EMSA-PSS encoding operation defined in RFC 8017 §9.1.1. Given a message digest, an encoded-message bit l…
  • emsa-pss-verify — Implements the EMSA-PSS verification operation defined in RFC 8017 §9.1.2. Given the message digest, the candidate enco…
  • mgf1 — Implements the MGF1 mask-generation function defined in RFC 8017 §B.2.1. MGF1 is the building block used by EMSA-PSS an…
  • default-rng — Single canonical adapter that lifts the crypto.getRandomValues CSPRNG into the @suaveplan/types Rng interface eve…
  • oaep — RSAES-OAEP encryption per RFC 8017 §7.1.1. The Optimal Asymmetric Encryption Padding (OAEP) scheme is the modern defaul…
  • pkcs1v15 — RSAES-PKCS1-v1_5 encryption per RFC 8017 §7.2.1 — the legacy public-key encryption padding scheme historically used by…
  • noble — Default RsaCryptoEngine backed by the pure-JS noble primitives this package ships natively. Provides the `name: "nobl…
  • select — Resolve the default RsaCryptoEngine for the host runtime. When globalThis.crypto.subtle exposes the RSA algorithms…
  • subtle — RsaCryptoEngine adapter over globalThis.crypto.subtle. When the host runtime exposes WebCrypto, this engine routes…
  • errors — (no submodules)+ errors — (no submodules)+ format — Render a fingerprint byte sequence as a human- and machine-readable string. Provides four output formats covering every…
  • spki — Compute a deterministic fingerprint of an RSA public key by hashing its SPKI DER encoding (RFC 5280 §4.1 `SubjectPublic…
  • registry — Process-wide registry for RSA key-handle providers. Every HSM, KMS, OS keychain, or PKCS#11 bridge registers a provider…
  • software — Reference RsaKeyHandleProvider wrapping in-memory RsaPrivateKey values. Implements the same interface as a real HSM…
  • thumbprint-uri — Compute the JWK Thumbprint URI per RFC 9278 §3 — the canonical `urn:ietf:params:oauth:jwk-thumbprint::<base64…
  • thumbprint — Compute the JWK Thumbprint of an RSA public key per RFC 7638 §3.2. The thumbprint is a deterministic hash over the cano…
  • exponent — Public-exponent validation for RSA key generation. The e-only constraints (odd, > 1, < 2^256) live here so they c…
  • generate — RSA key-pair generation per NIST FIPS 186-5 Appendix A.1 and SP 800-56B Rev. 2 §6.3. Two-prime by default; multi-prime…
  • miller-rabin — Probable-prime test per NIST FIPS 186-5 Appendix B.3.1, used by generateRsaKeyPair to qualify candidate primes during…
  • multi-prime — Multi-prime RSA key generation per RFC 8017 §3 and PKCS #1 Appendix A.1.2 OtherPrimeInfos extension. Reachable via th…
  • jwk-policy — Cross-check a JWK's key_ops, use, and alg members against the requested operation per RFC 7517 §4.2 / §4.3 / §4.4…
  • oid — Centralised OID constants for the RSA wire formats handled by this package. Currently exports OID_RSA_ENCRYPTION (`1.…
  • parse-jwk — Parses RSA JWKs per RFC 7517 §6.3.1 (public) and §6.3.2 (private). Accepts the JWK as a plain JS object literal, as a J…
  • parse-pkcs1-private — Parses a DER-encoded RSAPrivateKey per RFC 8017 Appendix A.1.2 into the canonical RsaPrivateKey shape with mandator…
  • parse-pkcs1-public — Parses a DER-encoded RSAPublicKey ::= SEQUENCE { modulus INTEGER, publicExponent INTEGER } per RFC 8017 Appendix A.1.…
  • parse-pkcs8 — Parses a PKCS#8 PrivateKeyInfo per RFC 5208 §5 — also accepts the RFC 5958 OneAsymmetricKey shape, which adds optio…
  • parse-spki — Parses an X.509 SubjectPublicKeyInfo per RFC 5280 §4.1 + Appendix A and unwraps the inner PKCS#1 RSAPublicKey. SPKI…
  • parse — Public dispatcher entry-point unifying the four key-format parsers (PKCS#1, SPKI, PKCS#8, JWK) under one ergonomic call…
  • serialize-jwk — Inverse of parseRsaPublicKeyJwk and parseRsaPrivateKeyJwk. Emits an RsaJwk with every numeric field encoded as ba…
  • serialize-pkcs1-private — Inverse of parseRsaPrivateKeyPkcs1. Emits a DER RSAPrivateKey SEQUENCE per RFC 8017 Appendix A.1.2 from a canonical…
  • serialize-pkcs1-public — Inverse of parseRsaPublicKeyPkcs1. Emits a DER RSAPublicKey SEQUENCE per RFC 8017 Appendix A.1.1 from a canonical `…
  • serialize-pkcs8 — Inverse of parseRsaPrivateKeyPkcs8. Wraps a serialised PKCS#1 RSAPrivateKey in a DER PrivateKeyInfo per RFC 5208…
  • serialize-spki — Inverse of parseRsaPublicKeySpki. Wraps a serialised PKCS#1 RSAPublicKey in a DER SubjectPublicKeyInfo per RFC 52…
  • serialize — Public dispatcher entry-point inverse of parse. Selects the per-format serialiser via the same format discriminator…
  • crt — RSA private-key operation via the Chinese Remainder Theorem (RFC 8017 §5.1.2, second-form algorithm). Computes `m = c^d…
  • i2osp — Integer-to-Octet-String Primitive (RFC 8017 §4.1). Encodes a non-negative integer as a fixed-length big-endian byte str…
  • modpow — Single-source-of-truth modular exponentiation for the entire @suaveplan/crypto-rsa package. Wraps `@noble/curves/abst…
  • os2ip — Octet-String-to-Integer Primitive (RFC 8017 §4.2). Decodes a big-endian byte string into a non-negative bigint. Used…
  • metrics — OpenTelemetry meter + instrument registry for @suaveplan/crypto-rsa. defines the full instrument set the prop…
  • timing — Centralised high-resolution clock source used by every metric histogram in @suaveplan/crypto-rsa. Resolves to `perfor…
  • labels — Centralised PEM textual labels per RFC 7468 §5/§10/§11 used by the public and private PEM parsers and serialisers in th…
  • parse-private — Parse an RSA private key from RFC 7468 PEM textual encoding. Accepts the two canonical private-key armor labels — `"PRI…
  • parse-public — Parse an RSA public key from RFC 7468 PEM textual encoding. Accepts both canonical armor labels — "PUBLIC KEY" (SPKI…
  • pem-codec — Underlying RFC 7468 textual-encoding codec used by the four PEM parse/serialise entry points in this module. Splits the…
  • serialize-private — Inverse of parseRsaPrivateKeyPem. Emits PEM textual encoding for an RSA private key in either PKCS#8 ("PRIVATE KEY"…
  • serialize-public — Inverse of parseRsaPublicKeyPem. Emits PEM textual encoding for an RSA public key in either SPKI ("PUBLIC KEY", the…
  • policy — (no submodules)+ modulus — (no submodules)+ profile — (no submodules)+ profile — (no submodules)+ schemas — (no submodules)+ schemas — (no submodules)+ pkcs1v15 — RSASSA-PKCS1-v1_5 signature generation per RFC 8017 §8.2.1. Hashes the message with the configured algorithm, applies…
  • pss — RSASSA-PSS signature generation per RFC 8017 §8.1.1. Hashes the message, draws a random salt of the configured length,…
  • pkcs1v15 — RSASSA-PKCS1-v1_5 signature verification per RFC 8017 §8.2.2. Recovers the encoded message from signature via `s^e m…
  • pss — RSASSA-PSS signature verification per RFC 8017 §8.1.2. Recovers the encoded message via s^e mod n, then runs the EMSA…
  • blinded_vs_unblinded_2048 — (no submodules)+ rsa-2048-key — Real 2048-bit RSA keypair generated once at module-load time and exposed as canonical RsaPublicKey / RsaPrivateKey…
  • test-keys — Tiny synthetic RSA keypair for unit tests that need an RsaPrivateKey / RsaPublicKey shape but don't need to run a r…
  • reader — Strict-DER reader scoped to the RSA key shapes defined in RFC 8017 Appendix A (PKCS#1), RFC 5280 §4.1 + Appendix A (`Su…
  • writer — Strict-DER encoder mirroring asn1/reader. Encodes the same minimal subset of ASN.1 needed to serialise RSA keys in PK…
  • blinding — (no submodules)+ blinding — (no submodules)+ oaep — RSAES-OAEP decryption per RFC 8017 §7.1.2 — counterpart to encrypt/oaep. Modern default for RSA public-key encryption.
  • pkcs1v15 — RSAES-PKCS1-v1_5 decryption per RFC 8017 §7.2.2. Counterpart to encrypt/pkcs1v15. Provides legacy interop for protoco…
  • emsa-pkcs1-v1_5 — Implements EMSA-PKCS1-v1_5-ENCODE from RFC 8017 §9.2 — the encoding method underlying RSASSA-PKCS1-v1_5 signatures. T…
  • emsa-pss-encode — Implements the EMSA-PSS encoding operation defined in RFC 8017 §9.1.1. Given a message digest, an encoded-message bit l…
  • emsa-pss-verify — Implements the EMSA-PSS verification operation defined in RFC 8017 §9.1.2. Given the message digest, the candidate enco…
  • mgf1 — Implements the MGF1 mask-generation function defined in RFC 8017 §B.2.1. MGF1 is the building block used by EMSA-PSS an…
  • default-rng — Single canonical adapter that lifts the crypto.getRandomValues CSPRNG into the @suaveplan/types Rng interface eve…
  • oaep — RSAES-OAEP encryption per RFC 8017 §7.1.1. The Optimal Asymmetric Encryption Padding (OAEP) scheme is the modern defaul…
  • pkcs1v15 — RSAES-PKCS1-v1_5 encryption per RFC 8017 §7.2.1 — the legacy public-key encryption padding scheme historically used by…
  • noble — Default RsaCryptoEngine backed by the pure-JS noble primitives this package ships natively. Provides the `name: "nobl…
  • select — Resolve the default RsaCryptoEngine for the host runtime. When globalThis.crypto.subtle exposes the RSA algorithms…
  • subtle — RsaCryptoEngine adapter over globalThis.crypto.subtle. When the host runtime exposes WebCrypto, this engine routes…
  • errors — (no submodules)+ errors — (no submodules)+ format — Render a fingerprint byte sequence as a human- and machine-readable string. Provides four output formats covering every…
  • spki — Compute a deterministic fingerprint of an RSA public key by hashing its SPKI DER encoding (RFC 5280 §4.1 `SubjectPublic…
  • registry — Process-wide registry for RSA key-handle providers. Every HSM, KMS, OS keychain, or PKCS#11 bridge registers a provider…
  • software — Reference RsaKeyHandleProvider wrapping in-memory RsaPrivateKey values. Implements the same interface as a real HSM…
  • thumbprint-uri — Compute the JWK Thumbprint URI per RFC 9278 §3 — the canonical `urn:ietf:params:oauth:jwk-thumbprint::<base64…
  • thumbprint — Compute the JWK Thumbprint of an RSA public key per RFC 7638 §3.2. The thumbprint is a deterministic hash over the cano…
  • exponent — Public-exponent validation for RSA key generation. The e-only constraints (odd, > 1, < 2^256) live here so they c…
  • generate — RSA key-pair generation per NIST FIPS 186-5 Appendix A.1 and SP 800-56B Rev. 2 §6.3. Two-prime by default; multi-prime…
  • miller-rabin — Probable-prime test per NIST FIPS 186-5 Appendix B.3.1, used by generateRsaKeyPair to qualify candidate primes during…
  • multi-prime — Multi-prime RSA key generation per RFC 8017 §3 and PKCS #1 Appendix A.1.2 OtherPrimeInfos extension. Reachable via th…
  • jwk-policy — Cross-check a JWK's key_ops, use, and alg members against the requested operation per RFC 7517 §4.2 / §4.3 / §4.4…
  • oid — Centralised OID constants for the RSA wire formats handled by this package. Currently exports OID_RSA_ENCRYPTION (`1.…
  • parse-jwk — Parses RSA JWKs per RFC 7517 §6.3.1 (public) and §6.3.2 (private). Accepts the JWK as a plain JS object literal, as a J…
  • parse-pkcs1-private — Parses a DER-encoded RSAPrivateKey per RFC 8017 Appendix A.1.2 into the canonical RsaPrivateKey shape with mandator…
  • parse-pkcs1-public — Parses a DER-encoded RSAPublicKey ::= SEQUENCE { modulus INTEGER, publicExponent INTEGER } per RFC 8017 Appendix A.1.…
  • parse-pkcs8 — Parses a PKCS#8 PrivateKeyInfo per RFC 5208 §5 — also accepts the RFC 5958 OneAsymmetricKey shape, which adds optio…
  • parse-spki — Parses an X.509 SubjectPublicKeyInfo per RFC 5280 §4.1 + Appendix A and unwraps the inner PKCS#1 RSAPublicKey. SPKI…
  • parse — Public dispatcher entry-point unifying the four key-format parsers (PKCS#1, SPKI, PKCS#8, JWK) under one ergonomic call…
  • serialize-jwk — Inverse of parseRsaPublicKeyJwk and parseRsaPrivateKeyJwk. Emits an RsaJwk with every numeric field encoded as ba…
  • serialize-pkcs1-private — Inverse of parseRsaPrivateKeyPkcs1. Emits a DER RSAPrivateKey SEQUENCE per RFC 8017 Appendix A.1.2 from a canonical…
  • serialize-pkcs1-public — Inverse of parseRsaPublicKeyPkcs1. Emits a DER RSAPublicKey SEQUENCE per RFC 8017 Appendix A.1.1 from a canonical `…
  • serialize-pkcs8 — Inverse of parseRsaPrivateKeyPkcs8. Wraps a serialised PKCS#1 RSAPrivateKey in a DER PrivateKeyInfo per RFC 5208…
  • serialize-spki — Inverse of parseRsaPublicKeySpki. Wraps a serialised PKCS#1 RSAPublicKey in a DER SubjectPublicKeyInfo per RFC 52…
  • serialize — Public dispatcher entry-point inverse of parse. Selects the per-format serialiser via the same format discriminator…
  • crt — RSA private-key operation via the Chinese Remainder Theorem (RFC 8017 §5.1.2, second-form algorithm). Computes `m = c^d…
  • i2osp — Integer-to-Octet-String Primitive (RFC 8017 §4.1). Encodes a non-negative integer as a fixed-length big-endian byte str…
  • modpow — Single-source-of-truth modular exponentiation for the entire @suaveplan/crypto-rsa package. Wraps `@noble/curves/abst…
  • os2ip — Octet-String-to-Integer Primitive (RFC 8017 §4.2). Decodes a big-endian byte string into a non-negative bigint. Used…
  • metrics — OpenTelemetry meter + instrument registry for @suaveplan/crypto-rsa. defines the full instrument set the prop…
  • timing — Centralised high-resolution clock source used by every metric histogram in @suaveplan/crypto-rsa. Resolves to `perfor…
  • labels — Centralised PEM textual labels per RFC 7468 §5/§10/§11 used by the public and private PEM parsers and serialisers in th…
  • parse-private — Parse an RSA private key from RFC 7468 PEM textual encoding. Accepts the two canonical private-key armor labels — `"PRI…
  • parse-public — Parse an RSA public key from RFC 7468 PEM textual encoding. Accepts both canonical armor labels — "PUBLIC KEY" (SPKI…
  • pem-codec — Underlying RFC 7468 textual-encoding codec used by the four PEM parse/serialise entry points in this module. Splits the…
  • serialize-private — Inverse of parseRsaPrivateKeyPem. Emits PEM textual encoding for an RSA private key in either PKCS#8 ("PRIVATE KEY"…
  • serialize-public — Inverse of parseRsaPublicKeyPem. Emits PEM textual encoding for an RSA public key in either SPKI ("PUBLIC KEY", the…
  • policy — (no submodules)+ modulus — (no submodules)+ profile — (no submodules)+ profile — (no submodules)+ schemas — (no submodules)+ schemas — (no submodules)+ pkcs1v15 — RSASSA-PKCS1-v1_5 signature generation per RFC 8017 §8.2.1. Hashes the message with the configured algorithm, applies…
  • pss — RSASSA-PSS signature generation per RFC 8017 §8.1.1. Hashes the message, draws a random salt of the configured length,…
  • pkcs1v15 — RSASSA-PKCS1-v1_5 signature verification per RFC 8017 §8.2.2. Recovers the encoded message from signature via `s^e m…
  • pss — RSASSA-PSS signature verification per RFC 8017 §8.1.2. Recovers the encoded message via s^e mod n, then runs the EMSA…
  • blinded_vs_unblinded_2048 — (no submodules)+ rsa-2048-key — Real 2048-bit RSA keypair generated once at module-load time and exposed as canonical RsaPublicKey / RsaPrivateKey…
  • test-keys — Tiny synthetic RSA keypair for unit tests that need an RsaPrivateKey / RsaPublicKey shape but don't need to run a r…
  • reader — Strict-DER reader scoped to the RSA key shapes defined in RFC 8017 Appendix A (PKCS#1), RFC 5280 §4.1 + Appendix A (`Su…
  • writer — Strict-DER encoder mirroring asn1/reader. Encodes the same minimal subset of ASN.1 needed to serialise RSA keys in PK…
  • blinding — (no submodules)+ blinding — (no submodules)+ oaep — RSAES-OAEP decryption per RFC 8017 §7.1.2 — counterpart to encrypt/oaep. Modern default for RSA public-key encryption.
  • pkcs1v15 — RSAES-PKCS1-v1_5 decryption per RFC 8017 §7.2.2. Counterpart to encrypt/pkcs1v15. Provides legacy interop for protoco…
  • emsa-pkcs1-v1_5 — Implements EMSA-PKCS1-v1_5-ENCODE from RFC 8017 §9.2 — the encoding method underlying RSASSA-PKCS1-v1_5 signatures. T…
  • emsa-pss-encode — Implements the EMSA-PSS encoding operation defined in RFC 8017 §9.1.1. Given a message digest, an encoded-message bit l…
  • emsa-pss-verify — Implements the EMSA-PSS verification operation defined in RFC 8017 §9.1.2. Given the message digest, the candidate enco…
  • mgf1 — Implements the MGF1 mask-generation function defined in RFC 8017 §B.2.1. MGF1 is the building block used by EMSA-PSS an…
  • default-rng — Single canonical adapter that lifts the crypto.getRandomValues CSPRNG into the @suaveplan/types Rng interface eve…
  • oaep — RSAES-OAEP encryption per RFC 8017 §7.1.1. The Optimal Asymmetric Encryption Padding (OAEP) scheme is the modern defaul…
  • pkcs1v15 — RSAES-PKCS1-v1_5 encryption per RFC 8017 §7.2.1 — the legacy public-key encryption padding scheme historically used by…
  • noble — Default RsaCryptoEngine backed by the pure-JS noble primitives this package ships natively. Provides the `name: "nobl…
  • select — Resolve the default RsaCryptoEngine for the host runtime. When globalThis.crypto.subtle exposes the RSA algorithms…
  • subtle — RsaCryptoEngine adapter over globalThis.crypto.subtle. When the host runtime exposes WebCrypto, this engine routes…
  • errors — (no submodules)+ errors — (no submodules)+ format — Render a fingerprint byte sequence as a human- and machine-readable string. Provides four output formats covering every…
  • spki — Compute a deterministic fingerprint of an RSA public key by hashing its SPKI DER encoding (RFC 5280 §4.1 `SubjectPublic…
  • registry — Process-wide registry for RSA key-handle providers. Every HSM, KMS, OS keychain, or PKCS#11 bridge registers a provider…
  • software — Reference RsaKeyHandleProvider wrapping in-memory RsaPrivateKey values. Implements the same interface as a real HSM…
  • thumbprint-uri — Compute the JWK Thumbprint URI per RFC 9278 §3 — the canonical `urn:ietf:params:oauth:jwk-thumbprint::<base64…
  • thumbprint — Compute the JWK Thumbprint of an RSA public key per RFC 7638 §3.2. The thumbprint is a deterministic hash over the cano…
  • exponent — Public-exponent validation for RSA key generation. The e-only constraints (odd, > 1, < 2^256) live here so they c…
  • generate — RSA key-pair generation per NIST FIPS 186-5 Appendix A.1 and SP 800-56B Rev. 2 §6.3. Two-prime by default; multi-prime…
  • miller-rabin — Probable-prime test per NIST FIPS 186-5 Appendix B.3.1, used by generateRsaKeyPair to qualify candidate primes during…
  • multi-prime — Multi-prime RSA key generation per RFC 8017 §3 and PKCS #1 Appendix A.1.2 OtherPrimeInfos extension. Reachable via th…
  • jwk-policy — Cross-check a JWK's key_ops, use, and alg members against the requested operation per RFC 7517 §4.2 / §4.3 / §4.4…
  • oid — Centralised OID constants for the RSA wire formats handled by this package. Currently exports OID_RSA_ENCRYPTION (`1.…
  • parse-jwk — Parses RSA JWKs per RFC 7517 §6.3.1 (public) and §6.3.2 (private). Accepts the JWK as a plain JS object literal, as a J…
  • parse-pkcs1-private — Parses a DER-encoded RSAPrivateKey per RFC 8017 Appendix A.1.2 into the canonical RsaPrivateKey shape with mandator…
  • parse-pkcs1-public — Parses a DER-encoded RSAPublicKey ::= SEQUENCE { modulus INTEGER, publicExponent INTEGER } per RFC 8017 Appendix A.1.…
  • parse-pkcs8 — Parses a PKCS#8 PrivateKeyInfo per RFC 5208 §5 — also accepts the RFC 5958 OneAsymmetricKey shape, which adds optio…
  • parse-spki — Parses an X.509 SubjectPublicKeyInfo per RFC 5280 §4.1 + Appendix A and unwraps the inner PKCS#1 RSAPublicKey. SPKI…
  • parse — Public dispatcher entry-point unifying the four key-format parsers (PKCS#1, SPKI, PKCS#8, JWK) under one ergonomic call…
  • serialize-jwk — Inverse of parseRsaPublicKeyJwk and parseRsaPrivateKeyJwk. Emits an RsaJwk with every numeric field encoded as ba…
  • serialize-pkcs1-private — Inverse of parseRsaPrivateKeyPkcs1. Emits a DER RSAPrivateKey SEQUENCE per RFC 8017 Appendix A.1.2 from a canonical…
  • serialize-pkcs1-public — Inverse of parseRsaPublicKeyPkcs1. Emits a DER RSAPublicKey SEQUENCE per RFC 8017 Appendix A.1.1 from a canonical `…
  • serialize-pkcs8 — Inverse of parseRsaPrivateKeyPkcs8. Wraps a serialised PKCS#1 RSAPrivateKey in a DER PrivateKeyInfo per RFC 5208…
  • serialize-spki — Inverse of parseRsaPublicKeySpki. Wraps a serialised PKCS#1 RSAPublicKey in a DER SubjectPublicKeyInfo per RFC 52…
  • serialize — Public dispatcher entry-point inverse of parse. Selects the per-format serialiser via the same format discriminator…
  • crt — RSA private-key operation via the Chinese Remainder Theorem (RFC 8017 §5.1.2, second-form algorithm). Computes `m = c^d…
  • i2osp — Integer-to-Octet-String Primitive (RFC 8017 §4.1). Encodes a non-negative integer as a fixed-length big-endian byte str…
  • modpow — Single-source-of-truth modular exponentiation for the entire @suaveplan/crypto-rsa package. Wraps `@noble/curves/abst…
  • os2ip — Octet-String-to-Integer Primitive (RFC 8017 §4.2). Decodes a big-endian byte string into a non-negative bigint. Used…
  • metrics — OpenTelemetry meter + instrument registry for @suaveplan/crypto-rsa. defines the full instrument set the prop…
  • timing — Centralised high-resolution clock source used by every metric histogram in @suaveplan/crypto-rsa. Resolves to `perfor…
  • labels — Centralised PEM textual labels per RFC 7468 §5/§10/§11 used by the public and private PEM parsers and serialisers in th…
  • parse-private — Parse an RSA private key from RFC 7468 PEM textual encoding. Accepts the two canonical private-key armor labels — `"PRI…
  • parse-public — Parse an RSA public key from RFC 7468 PEM textual encoding. Accepts both canonical armor labels — "PUBLIC KEY" (SPKI…
  • pem-codec — Underlying RFC 7468 textual-encoding codec used by the four PEM parse/serialise entry points in this module. Splits the…
  • serialize-private — Inverse of parseRsaPrivateKeyPem. Emits PEM textual encoding for an RSA private key in either PKCS#8 ("PRIVATE KEY"…
  • serialize-public — Inverse of parseRsaPublicKeyPem. Emits PEM textual encoding for an RSA public key in either SPKI ("PUBLIC KEY", the…
  • policy — (no submodules)+ modulus — (no submodules)+ profile — (no submodules)+ profile — (no submodules)+ schemas — (no submodules)+ schemas — (no submodules)+ pkcs1v15 — RSASSA-PKCS1-v1_5 signature generation per RFC 8017 §8.2.1. Hashes the message with the configured algorithm, applies…
  • pss — RSASSA-PSS signature generation per RFC 8017 §8.1.1. Hashes the message, draws a random salt of the configured length,…
  • pkcs1v15 — RSASSA-PKCS1-v1_5 signature verification per RFC 8017 §8.2.2. Recovers the encoded message from signature via `s^e m…
  • pss — RSASSA-PSS signature verification per RFC 8017 §8.1.2. Recovers the encoded message via s^e mod n, then runs the EMSA…
  • blinded_vs_unblinded_2048 — (no submodules)+ rsa-2048-key — Real 2048-bit RSA keypair generated once at module-load time and exposed as canonical RsaPublicKey / RsaPrivateKey…
  • test-keys — Tiny synthetic RSA keypair for unit tests that need an RsaPrivateKey / RsaPublicKey shape but don't need to run a r…
  • reader — Strict-DER reader scoped to the RSA key shapes defined in RFC 8017 Appendix A (PKCS#1), RFC 5280 §4.1 + Appendix A (`Su…
  • writer — Strict-DER encoder mirroring asn1/reader. Encodes the same minimal subset of ASN.1 needed to serialise RSA keys in PK…
  • blinding — (no submodules) + blinding — (no submodules)+ oaep — RSAES-OAEP decryption per RFC 8017 §7.1.2 — counterpart to encrypt/oaep. Modern default for RSA public-key encryption.
  • pkcs1v15 — RSAES-PKCS1-v1_5 decryption per RFC 8017 §7.2.2. Counterpart to encrypt/pkcs1v15. Provides legacy interop for protoco…
  • emsa-pkcs1-v1_5 — Implements EMSA-PKCS1-v1_5-ENCODE from RFC 8017 §9.2 — the encoding method underlying RSASSA-PKCS1-v1_5 signatures. T…
  • emsa-pss-encode — Implements the EMSA-PSS encoding operation defined in RFC 8017 §9.1.1. Given a message digest, an encoded-message bit l…
  • emsa-pss-verify — Implements the EMSA-PSS verification operation defined in RFC 8017 §9.1.2. Given the message digest, the candidate enco…
  • mgf1 — Implements the MGF1 mask-generation function defined in RFC 8017 §B.2.1. MGF1 is the building block used by EMSA-PSS an…
  • default-rng — Single canonical adapter that lifts the crypto.getRandomValues CSPRNG into the @suaveplan/types Rng interface eve…
  • oaep — RSAES-OAEP encryption per RFC 8017 §7.1.1. The Optimal Asymmetric Encryption Padding (OAEP) scheme is the modern defaul…
  • pkcs1v15 — RSAES-PKCS1-v1_5 encryption per RFC 8017 §7.2.1 — the legacy public-key encryption padding scheme historically used by…
  • noble — Default RsaCryptoEngine backed by the pure-JS noble primitives this package ships natively. Provides the `name: "nobl…
  • select — Resolve the default RsaCryptoEngine for the host runtime. When globalThis.crypto.subtle exposes the RSA algorithms…
  • subtle — RsaCryptoEngine adapter over globalThis.crypto.subtle. When the host runtime exposes WebCrypto, this engine routes…
  • errors — (no submodules) + errors — (no submodules)+ format — Render a fingerprint byte sequence as a human- and machine-readable string. Provides four output formats covering every…
  • spki — Compute a deterministic fingerprint of an RSA public key by hashing its SPKI DER encoding (RFC 5280 §4.1 `SubjectPublic…
  • registry — Process-wide registry for RSA key-handle providers. Every HSM, KMS, OS keychain, or PKCS#11 bridge registers a provider…
  • software — Reference RsaKeyHandleProvider wrapping in-memory RsaPrivateKey values. Implements the same interface as a real HSM…
  • thumbprint-uri — Compute the JWK Thumbprint URI per RFC 9278 §3 — the canonical `urn:ietf:params:oauth:jwk-thumbprint::<base64…
  • thumbprint — Compute the JWK Thumbprint of an RSA public key per RFC 7638 §3.2. The thumbprint is a deterministic hash over the cano…
  • exponent — Public-exponent validation for RSA key generation. The e-only constraints (odd, > 1, < 2^256) live here so they c…
  • generate — RSA key-pair generation per NIST FIPS 186-5 Appendix A.1 and SP 800-56B Rev. 2 §6.3. Two-prime by default; multi-prime…
  • miller-rabin — Probable-prime test per NIST FIPS 186-5 Appendix B.3.1, used by generateRsaKeyPair to qualify candidate primes during…
  • multi-prime — Multi-prime RSA key generation per RFC 8017 §3 and PKCS #1 Appendix A.1.2 OtherPrimeInfos extension. Reachable via th…
  • jwk-policy — Cross-check a JWK's key_ops, use, and alg members against the requested operation per RFC 7517 §4.2 / §4.3 / §4.4…
  • oid — Centralised OID constants for the RSA wire formats handled by this package. Currently exports OID_RSA_ENCRYPTION (`1.…
  • parse-jwk — Parses RSA JWKs per RFC 7517 §6.3.1 (public) and §6.3.2 (private). Accepts the JWK as a plain JS object literal, as a J…
  • parse-pkcs1-private — Parses a DER-encoded RSAPrivateKey per RFC 8017 Appendix A.1.2 into the canonical RsaPrivateKey shape with mandator…
  • parse-pkcs1-public — Parses a DER-encoded RSAPublicKey ::= SEQUENCE { modulus INTEGER, publicExponent INTEGER } per RFC 8017 Appendix A.1.…
  • parse-pkcs8 — Parses a PKCS#8 PrivateKeyInfo per RFC 5208 §5 — also accepts the RFC 5958 OneAsymmetricKey shape, which adds optio…
  • parse-spki — Parses an X.509 SubjectPublicKeyInfo per RFC 5280 §4.1 + Appendix A and unwraps the inner PKCS#1 RSAPublicKey. SPKI…
  • parse — Public dispatcher entry-point unifying the four key-format parsers (PKCS#1, SPKI, PKCS#8, JWK) under one ergonomic call…
  • serialize-jwk — Inverse of parseRsaPublicKeyJwk and parseRsaPrivateKeyJwk. Emits an RsaJwk with every numeric field encoded as ba…
  • serialize-pkcs1-private — Inverse of parseRsaPrivateKeyPkcs1. Emits a DER RSAPrivateKey SEQUENCE per RFC 8017 Appendix A.1.2 from a canonical…
  • serialize-pkcs1-public — Inverse of parseRsaPublicKeyPkcs1. Emits a DER RSAPublicKey SEQUENCE per RFC 8017 Appendix A.1.1 from a canonical `…
  • serialize-pkcs8 — Inverse of parseRsaPrivateKeyPkcs8. Wraps a serialised PKCS#1 RSAPrivateKey in a DER PrivateKeyInfo per RFC 5208…
  • serialize-spki — Inverse of parseRsaPublicKeySpki. Wraps a serialised PKCS#1 RSAPublicKey in a DER SubjectPublicKeyInfo per RFC 52…
  • serialize — Public dispatcher entry-point inverse of parse. Selects the per-format serialiser via the same format discriminator…
  • crt — RSA private-key operation via the Chinese Remainder Theorem (RFC 8017 §5.1.2, second-form algorithm). Computes `m = c^d…
  • i2osp — Integer-to-Octet-String Primitive (RFC 8017 §4.1). Encodes a non-negative integer as a fixed-length big-endian byte str…
  • modpow — Single-source-of-truth modular exponentiation for the entire @suaveplan/crypto-rsa package. Wraps `@noble/curves/abst…
  • os2ip — Octet-String-to-Integer Primitive (RFC 8017 §4.2). Decodes a big-endian byte string into a non-negative bigint. Used…
  • metrics — OpenTelemetry meter + instrument registry for @suaveplan/crypto-rsa. defines the full instrument set the prop…
  • timing — Centralised high-resolution clock source used by every metric histogram in @suaveplan/crypto-rsa. Resolves to `perfor…
  • labels — Centralised PEM textual labels per RFC 7468 §5/§10/§11 used by the public and private PEM parsers and serialisers in th…
  • parse-private — Parse an RSA private key from RFC 7468 PEM textual encoding. Accepts the two canonical private-key armor labels — `"PRI…
  • parse-public — Parse an RSA public key from RFC 7468 PEM textual encoding. Accepts both canonical armor labels — "PUBLIC KEY" (SPKI…
  • pem-codec — Underlying RFC 7468 textual-encoding codec used by the four PEM parse/serialise entry points in this module. Splits the…
  • serialize-private — Inverse of parseRsaPrivateKeyPem. Emits PEM textual encoding for an RSA private key in either PKCS#8 ("PRIVATE KEY"…
  • serialize-public — Inverse of parseRsaPublicKeyPem. Emits PEM textual encoding for an RSA public key in either SPKI ("PUBLIC KEY", the…
  • policy — (no submodules) + modulus — (no submodules)+ profile — (no submodules) + profile — (no submodules)+ schemas — (no submodules) + schemas — (no submodules)+ pkcs1v15 — RSASSA-PKCS1-v1_5 signature generation per RFC 8017 §8.2.1. Hashes the message with the configured algorithm, applies…
  • pss — RSASSA-PSS signature generation per RFC 8017 §8.1.1. Hashes the message, draws a random salt of the configured length,…
  • pkcs1v15 — RSASSA-PKCS1-v1_5 signature verification per RFC 8017 §8.2.2. Recovers the encoded message from signature via `s^e m…
  • pss — RSASSA-PSS signature verification per RFC 8017 §8.1.2. Recovers the encoded message via s^e mod n, then runs the EMSA…

Install

bun add @suaveplan/crypto-rsa

Quick start — parse and serialise

import {
    parseRsaPublicKey,
    parseRsaPublicKeyPem,
    serializeRsaPublicKey,
    serializeRsaPublicKeyPem,
} from "@suaveplan/crypto-rsa";

// PEM in, PEM out (round-trip).
const key = parseRsaPublicKeyPem(spkiPemString);
const back = serializeRsaPublicKeyPem(key); // -----BEGIN PUBLIC KEY-----…

// DER + JWK round-trips.
const der = serializeRsaPublicKey(key, { format: "spki" });
const jwk = serializeRsaPublicKey(key, { format: "jwk" });
const fromDer = parseRsaPublicKey(der as Uint8Array, { format: "spki" });
const fromJwk = parseRsaPublicKey(jwk, { format: "jwk" });

Quick start — modulus policy

import { enforceMaxBitLength, enforceMinBitLength } from "@suaveplan/crypto-rsa/policy";

enforceMinBitLength(publicKey); // throws if < 2048 bits
enforceMinBitLength(legacyKey, { allowLegacy: true }); // accepts ≥ 1024 bits
enforceMaxBitLength(publicKey); // throws if > 16384 bits

Quick start — math primitives

import {
    modPow,
    i2osp,
    os2ip,
    rsaPrivateOperationCrt,
} from "@suaveplan/crypto-rsa/math";

const c = os2ip(ciphertext);
const m = rsaPrivateOperationCrt(c, privateKey); // CRT-aware private op
const plaintext = i2osp(m, ciphertext.length);
const v = modPow(c, publicKey.e, publicKey.n); // public op

Stage 1 modules

Module Doc
asn1/reader src/asn1/reader.md
asn1/writer src/asn1/writer.md
errors/errors src/errors/errors.md
keys/oid src/keys/oid.md
keys/parse-pkcs1-public src/keys/parse-pkcs1-public.md
keys/parse-pkcs1-private src/keys/parse-pkcs1-private.md
keys/parse-spki src/keys/parse-spki.md
keys/parse-pkcs8 src/keys/parse-pkcs8.md
keys/parse-jwk src/keys/parse-jwk.md
keys/parse src/keys/parse.md
keys/serialize-pkcs1-public src/keys/serialize-pkcs1-public.md
keys/serialize-pkcs1-private src/keys/serialize-pkcs1-private.md
keys/serialize-spki src/keys/serialize-spki.md
keys/serialize-pkcs8 src/keys/serialize-pkcs8.md
keys/serialize-jwk src/keys/serialize-jwk.md
keys/serialize src/keys/serialize.md
math/modpow src/math/modpow.md
math/i2osp src/math/i2osp.md
math/os2ip src/math/os2ip.md
math/crt src/math/crt.md
pem/labels src/pem/labels.md
pem/pem-codec src/pem/pem-codec.md
pem/parse-public src/pem/parse-public.md
pem/parse-private src/pem/parse-private.md
pem/serialize-public src/pem/serialize-public.md
pem/serialize-private src/pem/serialize-private.md
policy/modulus src/policy/modulus.md
schemas/schemas src/schemas/schemas.md
observability/metrics src/observability/metrics.md

Stage 2 modules

Module Doc
encoding/mgf1 src/encoding/mgf1.md
encoding/emsa-pkcs1-v1_5 src/encoding/emsa-pkcs1-v1_5.md
encoding/emsa-pss-encode src/encoding/emsa-pss-encode.md
encoding/emsa-pss-verify src/encoding/emsa-pss-verify.md
sign/pkcs1v15 src/sign/pkcs1v15.md
sign/pss src/sign/pss.md
verify/pkcs1v15 src/verify/pkcs1v15.md
verify/pss src/verify/pss.md
observability/timing src/observability/timing.md

Stage 3 modules

Module Doc
blinding/blinding src/blinding/blinding.md
encrypt/pkcs1v15 src/encrypt/pkcs1v15.md
encrypt/oaep src/encrypt/oaep.md
encrypt/default-rng src/encrypt/default-rng.md
decrypt/pkcs1v15 src/decrypt/pkcs1v15.md
decrypt/oaep src/decrypt/oaep.md
keygen/generate src/keygen/generate.md
keygen/miller-rabin src/keygen/miller-rabin.md
keygen/exponent src/keygen/exponent.md
keygen/multi-prime src/keygen/multi-prime.md

Stage 4 modules

Module Doc
jwk/thumbprint src/jwk/thumbprint.md
jwk/thumbprint-uri src/jwk/thumbprint-uri.md
fingerprint/spki src/fingerprint/spki.md
fingerprint/format src/fingerprint/format.md
engine/noble src/engine/noble.md
engine/subtle src/engine/subtle.md
engine/select src/engine/select.md
handle/registry src/handle/registry.md
handle/software src/handle/software.md
profile/profile src/profile/profile.md
keys/jwk-policy src/keys/jwk-policy.md

Stage roadmap

  • Stage 1: ASN.1 / DER, key parse + serialise (PKCS#1, SPKI, PKCS#8, JWK, PEM), modulus-length policy, math primitives, full error / observability registry.
  • Stage 2: MGF1, EMSA-PKCS1-v1_5, EMSA-PSS, sign / verify (RSASSA-PKCS1-v1_5 + PSS).
  • Stage 3: encrypt / decrypt (PKCS#1 v1.5 + OAEP), key generation (Miller-Rabin, multi-prime), blinding (RFC 8017 §5.1.2 / Kocher 1996).
  • Stage 4 (this release): blinding wired into sign paths, JWK thumbprint (RFC 7638)
    • thumbprint URI (RFC 9278), SPKI fingerprint with four output formats, RsaCryptoEngine adapter (noble + WebCrypto subtle + auto-selector), RsaKeyHandle HSM bridge with reference SoftwareRsaKeyHandleProvider, FIPS 186-5 profile, JWK key_ops / use / alg enforcement.

License

MIT