micro509 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/CHANGELOG.md +2119 -0
  2. package/README.md +105 -225
  3. package/dist/crypto/crypto.d.ts +42 -11
  4. package/dist/crypto/crypto.js +53 -22
  5. package/dist/crypto/crypto.js.map +1 -1
  6. package/dist/crypto.d.ts +2 -2
  7. package/dist/crypto.js +1 -2
  8. package/dist/der/der.d.ts +41 -33
  9. package/dist/der/der.js +26 -24
  10. package/dist/der/der.js.map +1 -1
  11. package/dist/index.d.ts +11 -11
  12. package/dist/index.js +19 -19
  13. package/dist/internal/asn1/asn1.d.ts +3 -6
  14. package/dist/internal/asn1/asn1.js +343 -43
  15. package/dist/internal/asn1/asn1.js.map +1 -1
  16. package/dist/internal/asn1/ber.js +146 -0
  17. package/dist/internal/asn1/ber.js.map +1 -0
  18. package/dist/internal/asn1/decode-refusal.js +29 -0
  19. package/dist/internal/asn1/decode-refusal.js.map +1 -0
  20. package/dist/internal/asn1/der.d.ts +38 -41
  21. package/dist/internal/asn1/der.js +131 -52
  22. package/dist/internal/asn1/der.js.map +1 -1
  23. package/dist/internal/asn1/oids.js +83 -53
  24. package/dist/internal/asn1/oids.js.map +1 -1
  25. package/dist/internal/asn1/oids2.js +1 -2
  26. package/dist/internal/asn1/oids2.js.map +1 -1
  27. package/dist/internal/crypto/algorithm-names.js +1 -2
  28. package/dist/internal/crypto/algorithm-names.js.map +1 -1
  29. package/dist/internal/crypto/ecdsa.js +13 -8
  30. package/dist/internal/crypto/ecdsa.js.map +1 -1
  31. package/dist/internal/crypto/hash.js +1 -2
  32. package/dist/internal/crypto/hash.js.map +1 -1
  33. package/dist/internal/crypto/pbes2.d.ts +24 -11
  34. package/dist/internal/crypto/pbes2.js +79 -26
  35. package/dist/internal/crypto/pbes2.js.map +1 -1
  36. package/dist/internal/crypto/rsa-pss.js +46 -44
  37. package/dist/internal/crypto/rsa-pss.js.map +1 -1
  38. package/dist/internal/crypto/sig-verify.d.ts +4 -7
  39. package/dist/internal/crypto/sig-verify.js +107 -60
  40. package/dist/internal/crypto/sig-verify.js.map +1 -1
  41. package/dist/internal/crypto/signing.d.ts +1 -4
  42. package/dist/internal/crypto/signing.js +28 -29
  43. package/dist/internal/crypto/signing.js.map +1 -1
  44. package/dist/internal/crypto/webcrypto.js +1 -2
  45. package/dist/internal/crypto/webcrypto.js.map +1 -1
  46. package/dist/internal/shared/base64.js +1 -2
  47. package/dist/internal/shared/base64.js.map +1 -1
  48. package/dist/internal/shared/dn.d.ts +3 -6
  49. package/dist/internal/shared/dn.js +99 -53
  50. package/dist/internal/shared/dn.js.map +1 -1
  51. package/dist/internal/shared/idna-tables.js +7217 -0
  52. package/dist/internal/shared/idna-tables.js.map +1 -0
  53. package/dist/internal/shared/idna.js +296 -0
  54. package/dist/internal/shared/idna.js.map +1 -0
  55. package/dist/internal/shared/ip.d.ts +4 -7
  56. package/dist/internal/shared/ip.js +1 -2
  57. package/dist/internal/shared/ip.js.map +1 -1
  58. package/dist/internal/shared/mailbox.js +26 -0
  59. package/dist/internal/shared/mailbox.js.map +1 -0
  60. package/dist/internal/shared/punycode.js +101 -0
  61. package/dist/internal/shared/punycode.js.map +1 -0
  62. package/dist/internal/shared/rfc3454-tables.js +1 -2
  63. package/dist/internal/shared/rfc3454-tables.js.map +1 -1
  64. package/dist/internal/shared/rfc4518-tables.js +119 -0
  65. package/dist/internal/shared/rfc4518-tables.js.map +1 -0
  66. package/dist/internal/shared/uri-host.js +102 -0
  67. package/dist/internal/shared/uri-host.js.map +1 -0
  68. package/dist/internal/verify/name-constraints-engine.js +246 -131
  69. package/dist/internal/verify/name-constraints-engine.js.map +1 -1
  70. package/dist/internal/verify/policy-engine.js +6 -21
  71. package/dist/internal/verify/policy-engine.js.map +1 -1
  72. package/dist/internal/verify/spki-distrust.js +23 -0
  73. package/dist/internal/verify/spki-distrust.js.map +1 -0
  74. package/dist/internal/verify/verify-path.d.ts +1 -4
  75. package/dist/internal/verify/verify-path.js +282 -129
  76. package/dist/internal/verify/verify-path.js.map +1 -1
  77. package/dist/internal/x509/directory-name.js +1 -2
  78. package/dist/internal/x509/directory-name.js.map +1 -1
  79. package/dist/internal/x509/extension-bits.js +2 -3
  80. package/dist/internal/x509/extension-bits.js.map +1 -1
  81. package/dist/internal/x509/extension-errors.d.ts +1 -4
  82. package/dist/internal/x509/extension-errors.js +1 -2
  83. package/dist/internal/x509/extension-errors.js.map +1 -1
  84. package/dist/internal/x509/extension-registry.js +107 -89
  85. package/dist/internal/x509/extension-registry.js.map +1 -1
  86. package/dist/internal/x509/general-name-profile.js +129 -0
  87. package/dist/internal/x509/general-name-profile.js.map +1 -0
  88. package/dist/internal/x509/general-name-tags.js +1 -2
  89. package/dist/internal/x509/general-name-tags.js.map +1 -1
  90. package/dist/internal/x509/general-name.js +128 -42
  91. package/dist/internal/x509/general-name.js.map +1 -1
  92. package/dist/internal/x509/name-fields.js +1 -2
  93. package/dist/internal/x509/name-fields.js.map +1 -1
  94. package/dist/internal/x509/or-address.js +217 -0
  95. package/dist/internal/x509/or-address.js.map +1 -0
  96. package/dist/keys/keys.d.ts +122 -104
  97. package/dist/keys/keys.js +211 -204
  98. package/dist/keys/keys.js.map +1 -1
  99. package/dist/keys.d.ts +3 -3
  100. package/dist/pem/pem.d.ts +14 -17
  101. package/dist/pem/pem.js +16 -17
  102. package/dist/pem/pem.js.map +1 -1
  103. package/dist/pem.js +1 -2
  104. package/dist/pkcs/pfx.d.ts +57 -32
  105. package/dist/pkcs/pfx.js +209 -173
  106. package/dist/pkcs/pfx.js.map +1 -1
  107. package/dist/pkcs/pkcs12-mac.d.ts +104 -27
  108. package/dist/pkcs/pkcs12-mac.js +266 -79
  109. package/dist/pkcs/pkcs12-mac.js.map +1 -1
  110. package/dist/pkcs/pkcs7.d.ts +43 -37
  111. package/dist/pkcs/pkcs7.js +218 -217
  112. package/dist/pkcs/pkcs7.js.map +1 -1
  113. package/dist/pkcs.d.ts +4 -3
  114. package/dist/result/result.d.ts +27 -20
  115. package/dist/result/result.js +8 -3
  116. package/dist/result/result.js.map +1 -1
  117. package/dist/result.d.ts +2 -2
  118. package/dist/result.js +1 -2
  119. package/dist/revocation/chain.d.ts +101 -23
  120. package/dist/revocation/chain.js +436 -182
  121. package/dist/revocation/chain.js.map +1 -1
  122. package/dist/revocation/crl.d.ts +131 -67
  123. package/dist/revocation/crl.js +443 -327
  124. package/dist/revocation/crl.js.map +1 -1
  125. package/dist/revocation/ocsp.d.ts +94 -59
  126. package/dist/revocation/ocsp.js +331 -293
  127. package/dist/revocation/ocsp.js.map +1 -1
  128. package/dist/revocation/revocation.d.ts +47 -35
  129. package/dist/revocation/revocation.js +88 -57
  130. package/dist/revocation/revocation.js.map +1 -1
  131. package/dist/revocation.d.ts +3 -3
  132. package/dist/verify/identity.d.ts +16 -19
  133. package/dist/verify/identity.js +118 -89
  134. package/dist/verify/identity.js.map +1 -1
  135. package/dist/verify/name-constraints.d.ts +1 -4
  136. package/dist/verify/policy.d.ts +9 -7
  137. package/dist/verify/verify.d.ts +115 -46
  138. package/dist/verify/verify.js +373 -183
  139. package/dist/verify/verify.js.map +1 -1
  140. package/dist/verify.d.ts +2 -2
  141. package/dist/x509/certificate.d.ts +20 -21
  142. package/dist/x509/certificate.js +62 -46
  143. package/dist/x509/certificate.js.map +1 -1
  144. package/dist/x509/csr.d.ts +5 -7
  145. package/dist/x509/csr.js +10 -11
  146. package/dist/x509/csr.js.map +1 -1
  147. package/dist/x509/extensions.d.ts +154 -66
  148. package/dist/x509/extensions.js +317 -151
  149. package/dist/x509/extensions.js.map +1 -1
  150. package/dist/x509/fingerprint.d.ts +15 -7
  151. package/dist/x509/fingerprint.js +20 -3
  152. package/dist/x509/fingerprint.js.map +1 -1
  153. package/dist/x509/name-text.d.ts +7 -9
  154. package/dist/x509/name-text.js +18 -4
  155. package/dist/x509/name-text.js.map +1 -1
  156. package/dist/x509/name.d.ts +9 -11
  157. package/dist/x509/name.js +18 -19
  158. package/dist/x509/name.js.map +1 -1
  159. package/dist/x509/parse.d.ts +84 -69
  160. package/dist/x509/parse.js +421 -400
  161. package/dist/x509/parse.js.map +1 -1
  162. package/dist/x509.d.ts +3 -3
  163. package/dist/x509.js +3 -3
  164. package/package.json +76 -59
package/CHANGELOG.md ADDED
@@ -0,0 +1,2119 @@
1
+ # Changelog
2
+
3
+ <!--
4
+ Release checklist — every box, every release:
5
+ - [ ] Move [Unreleased] entries under a new `## [X.Y.Z] - YYYY-MM-DD` header + intro line
6
+ - [ ] Bump version in package.json AND jsr.json
7
+ - [ ] Bump the version in examples/browser/index.html's import map. examples/vite/package.json uses `latest`
8
+ - [ ] Run `bun install` after the example bump so bun.lock matches; CI installs with a frozen lockfile
9
+ - [ ] Link definitions at the BOTTOM of this file: add [X.Y.Z] compare link, repoint [Unreleased]
10
+ - [ ] Verify the signature on the merged release commit, then create its signed release tag
11
+ - [ ] Push the tag to trigger the Publish workflow
12
+ - [ ] Verify npm, JSR, the GitHub release and the documentation deployment
13
+ -->
14
+
15
+ All notable changes to this project are documented in this file.
16
+
17
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
18
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
19
+
20
+ ## [Unreleased]
21
+
22
+ ## [0.16.0] - 2026-10-24
23
+
24
+ Block a compromised public key across every certificate that carries it,
25
+ including certificates cross-signed by different CAs. This release adds
26
+ SPKI-based distrust to chain verification, tightens indirect CRL issuer
27
+ matching, and reports the certificate responsible for a revocation failure.
28
+
29
+ It also adds explicit SHA-1 RSA-OAEP imports for legacy Bitwarden envelopes
30
+ and restores individual API reference pages with versioned documentation.
31
+
32
+ ### Added
33
+
34
+ - **Distrust compromised keys across certificate paths.** Supply SHA-256 SPKI
35
+ fingerprints through `distrustedSpkiSha256` to reject a key in a leaf,
36
+ intermediate, or trust anchor with `public_key_distrusted`. The same entry
37
+ covers certificates sharing that key across alternative cross-signed paths.
38
+ `subjectPublicKeyInfoFingerprint` computes the fingerprint from a
39
+ certificate and returns bytes, lowercase hex, and colon-separated hex.
40
+ Applications supply their own distrust list. [#178](https://github.com/kjanat/micro509/pull/178)
41
+ - **Import legacy RSA-OAEP keys.** Explicit RSA-OAEP imports accept
42
+ `hash: 'SHA-1'`, including keys for Bitwarden type 4 organization envelopes.
43
+ SHA-256 is the default. RSA signature imports and key generation accept
44
+ SHA-2 hashes. [#180](https://github.com/kjanat/micro509/issues/180)
45
+
46
+ ### Changed
47
+
48
+ - **Browse API documentation by symbol and version.** Functions, types, and
49
+ variables have dedicated pages at `/api/fn/`, `/api/type/`, and `/api/var/`.
50
+ The version switcher links to pages available in each snapshot. Algorithm
51
+ documentation distinguishes certificate parsing, key import, generation,
52
+ and signature verification support.
53
+ [#56](https://github.com/kjanat/micro509/issues/56),
54
+ [#179](https://github.com/kjanat/micro509/pull/179)
55
+ - **Read released and development docs separately.** The site root serves the
56
+ latest release, `/next/` follows master, and `/vX.Y.Z/` provides release
57
+ snapshots. Publishing updates the affected version without rebuilding every
58
+ archive. [#60](https://github.com/kjanat/micro509/issues/60)
59
+
60
+ ### Fixed
61
+
62
+ - **Reject incorrect indirect CRL issuer identities.** Every `cRLIssuer` entry
63
+ must be a `directoryName` with the exact DER encoding of the CRL issuer,
64
+ as required by RFC 5280 §4.2.1.13. A matching name alongside a URI or another
65
+ issuer no longer makes the CRL applicable. Equivalent names with different
66
+ DER encodings are also rejected. [#13](https://github.com/kjanat/micro509/issues/13)
67
+ - **Identify the certificate behind revocation failures.** Chain verification
68
+ reports the certificate index for revoked and indeterminate results,
69
+ including failures on intermediate certificates.
70
+ - **Serve the published docs tree in production.** Both build entrypoints
71
+ select the versioned publication. Deployment rejects preview-only output
72
+ and waits for the exact publication identifier and its documentation routes
73
+ to appear on the live site. An older deployment with an identical version
74
+ catalog cannot satisfy that check. [#185](https://github.com/kjanat/micro509/pull/185)
75
+
76
+ ## [0.15.0] - 2026-10-23
77
+
78
+ Security fixes for revocation decisions, name constraints and service identity,
79
+ with bounded KDF and certificate-path work on untrusted input. Revocation checks
80
+ examine all applicable OCSP responses and authenticate delta CRLs before selecting
81
+ evidence. Trusted OCSP responders are scoped to the CA they are authorized to serve.
82
+
83
+ This release also adds verification with existing CryptoKeys, typed UPN and Kerberos
84
+ names, IDNA2008 processing, PBMAC1 PFX MACs and broader browser coverage for the docs.
85
+ Certificate issuance inputs, CRL builder fields, parsed numeric values and revocation
86
+ results have breaking changes. See the [0.14 → 0.15 migration guide](https://micro509.kjanat.dev/guide/migration).
87
+
88
+ ### Added
89
+
90
+ - `verifySignatureWithKey` verifies detached signatures with an existing
91
+ WebCrypto public key, including non-extractable keys. It supports RSA,
92
+ RSA-PSS, ECDSA and Ed25519 through the same algorithm policy as
93
+ `verifySignature`, checks key usage and algorithm compatibility, and accepts
94
+ an explicit raw or DER signature encoding. No key export is required.
95
+ - `unrecognizedReasonCode` (`'revoked'` by default, or `'reject'`) on
96
+ `checkCertificateRevocationAgainstCrl`, `checkCertificateRevocation` and the
97
+ chain `RevocationPolicy`, and `responderRevocationUnrecognizedReasonCode` on
98
+ `validateOcspResponse`, choose the treatment of evidence that revokes a
99
+ certificate with a CRLReason outside [RFC 5280 §5.3.1][rfc5280-section-5.3.1]. `'reject'` reports
100
+ `reason_code_unrecognized`, at chain level `crl_reason_code_unrecognized` or
101
+ `ocsp_reason_code_unrecognized`, and keeps other evidence from settling the
102
+ status as `good`. A CRL signer that a CRL lists with a rejected code is
103
+ `crl_signer_indeterminate`, and a delegated OCSP responder listed with one
104
+ fails with `responder_revocation_unknown` under every
105
+ `responderRevocationPolicy` that checks CRLs.
106
+ - `SubjectAltName` variants `upn` (szOID_NT_PRINCIPAL_NAME, a UTF8String per
107
+ [MS-WCCE] §2.2.2.7.5) and `krb5PrincipalName` (`realm`, `nameType`,
108
+ `nameString`, id-pkinit-san per [RFC 4556][rfc4556] §3.2.2). Parsing types an otherName
109
+ that fits one of them and keeps any other value, such as an [RFC 6806][rfc6806]
110
+ KerberosString UPN, as a generic `otherName`. The builder refuses a generic
111
+ `otherName` that fits a variant with `other_name_type_id_has_variant`, and a
112
+ KRB5PrincipalName whose realm holds NUL, whose components are not
113
+ KerberosString text or whose name type is not an Int32 with the new
114
+ `invalid_krb5_principal_name`. Both forms remain unprocessed in a critical
115
+ subjectAltName and fail closed under name constraints.
116
+
117
+ - The DER and BER readers accept high-tag-number identifiers (X.690 §8.1.2.4)
118
+ for tag numbers from 31 up, and `DerElement.tagNumber` carries the tag number
119
+ within its class. An otherName value, a SafeBag value and a OneAsymmetricKey
120
+ extension field may use them. A tag number below 31 in that form, one whose
121
+ first subsequent octet is `0x80`, and one that ends before its final octet,
122
+ however long, are `malformed`. `checkStrictDer` reports
123
+ UNIVERSAL 31 to 36 as `unsupported` and the reserved numbers from 37 up as
124
+ `malformed`.
125
+ - IDNA2008 ([RFC 5890][rfc5890]-5893, [RFC 8753][rfc8753]) over frozen Unicode 12.0.0 tables
126
+ derived from the IANA registry. The builder converts U-labels to A-labels
127
+ in dNSName and rfc822Name SANs, SmtpUTF8Mailbox domains, the Name of a
128
+ SRVName, and dNSName and rfc822Name constraints, and fails with
129
+ `invalid_idn` on a label that is not valid IDNA2008, an `xn--` label that is
130
+ not an A-label, or an ASCII label beside an IDN label that is not NR-LDH. A
131
+ dNSName or rfc822Name domain, SAN or constraint, that ends in the root dot
132
+ fails with `domain_trailing_dot`. [RFC 5280 §4.2.1.6][rfc5280-section-4.2.1.6] requires the [RFC 1034
133
+ §3.5][rfc1034-section-3.5] preferred name syntax, which has no trailing dot.
134
+ - [RFC 9608][rfc9608] `noRevAvail` (id-ce 56). Parsing exposes it as
135
+ `ParsedCertificate.noRevAvail`, and `extensions.noRevAvail: true` emits it.
136
+ The builder refuses it beside cA TRUE, `crlDistributionPoints`, freshestCRL
137
+ or an `ocsp` authorityInfoAccess entry (`no_rev_avail_conflict`), and path
138
+ validation rejects such a certificate with the new `no_rev_avail_conflict`
139
+ verify code. `checkChainRevocation` and `verifyCertificateChain({
140
+ revocation })` report a certificate carrying `noRevAvail` or
141
+ `id-pkix-ocsp-nocheck` as the new `status: 'skipped'` with a `skipReason`,
142
+ without consulting evidence ([RFC 9608 §4][rfc9608-section-4]). The exemption is read from the
143
+ certificate's signed DER.
144
+ - `maxKdfIterations` on the encrypted PKCS#8 imports (`ImportEncryptedKeyOptions`,
145
+ fourth argument), `parsePfxDer` / `parsePfxPem` options, and
146
+ `parsePkcs12MacData` bounds the PBKDF2 and PKCS#12 KDF iteration counts a
147
+ file may demand. Above the bound the import fails with
148
+ `kdf_iterations_exceeded` before any derivation runs. The default is
149
+ 2,000,000 for PBKDF2, including the PBKDF2 behind PBMAC1, and 100,000 for the
150
+ PKCS#12 KDF. [RFC 7292 Appendix B][rfc7292-appendix-B] makes one hash call per round, and each call
151
+ is a separate WebCrypto digest, while PBKDF2 runs natively inside WebCrypto.
152
+ Without a password `parsePkcs12MacData` derives no key and does not apply the
153
+ bound. See Security.
154
+ - `maxAgeMs` on `validateCertificateRevocationList` and
155
+ `checkCertificateRevocationAgainstCrl`, `crlMaxAgeMs` on
156
+ `checkCertificateRevocation` and the chain-level `RevocationPolicy`, and
157
+ `responderRevocationCrlMaxAgeMs` on `validateOcspResponse` bound how old a
158
+ CRL's `thisUpdate` may be. The chain-level `crlMaxAgeMs` also covers the CRLs
159
+ for CRL signers and delegated OCSP responders. A CRL older than the bound
160
+ fails with `stale_crl`, and the chain reports `crl_expired` for it.
161
+ `clockSkewMs` widens each bound. No bound is set by default. [RFC 5280 §3.3][rfc5280-section-3.3]
162
+ leaves the required recency of revocation data to local policy. See
163
+ Security.
164
+ - `clockSkewMs` on the chain-level `RevocationPolicy` sets the tolerance for
165
+ CRL and OCSP `thisUpdate` and `nextUpdate` checks in `checkChainRevocation`
166
+ and `verifyCertificateChain({ revocation })`.
167
+ - `maxPathBuildingChecks` on `verifyCertificateChain`, `buildCandidatePath`
168
+ and the `validateFor*` profiles bounds how many issuer candidates and bare
169
+ trust anchors one path search may examine, counting candidates it skips as
170
+ already on the path or as a name mismatch. When the bound stops the search,
171
+ the result is `path_building_limit_exceeded`, which joins
172
+ `VERIFY_ERROR_CODES`. The default is 100,000.
173
+ - [RFC 9879][rfc9879] PBMAC1 for the PKCS#12 MacData. `parsePfxDer`, `parsePfxPem` and
174
+ `parsePkcs12MacData` verify a PBMAC1 MAC keyed by PBKDF2 with an
175
+ HMAC-SHA-256, HMAC-SHA-384 or HMAC-SHA-512 PRF and MAC. The PBKDF2 params
176
+ must carry `keyLength`, and the password is encoded as UTF-8 with no NULL
177
+ terminator. `createPfx` and `createPkcs12MacData` create one with
178
+ `mac: { type: 'pbmac1', password }`, using PBKDF2-HMAC-SHA-256, a 32-octet
179
+ key and HMAC-SHA-256. The default MAC is unchanged. `parsePkcs12MacData`
180
+ returns a `ParsedPkcs12MacData` discriminated by `type` (`'pkcs12-kdf'` or
181
+ `'pbmac1'`). New codes on `ParsePfxErrorCode` and
182
+ `ParsePkcs12MacDataErrorCode`: `unsupported_mac_algorithm` for a MAC or
183
+ PBMAC1 variant micro509 does not handle, `weak_mac_key_length` for a PBKDF2
184
+ `keyLength` below 20 octets, and `password_not_utf8` for a password with an
185
+ unpaired UTF-16 surrogate. A PBMAC1 PBKDF2 count above 4294967295 returns
186
+ `malformed`, as it does for PBES2.
187
+ - An opt-in [RFC 9919][rfc9919] OCSP client profile. `profile: 'rfc9919'` on
188
+ `validateOcspResponse`, and `ocspProfile: 'rfc9919'` on
189
+ `checkCertificateRevocation` and the chain-level `RevocationPolicy`, reject a
190
+ response without `nextUpdate` ([RFC 9919 §5][rfc9919-section-5]). `validateOcspResponse` and
191
+ `checkCertificateRevocation` report `next_update_missing`, and the chain
192
+ reports `ocsp_next_update_missing`. The default `'rfc6960'` profile accepts
193
+ such a response, as [RFC 6960 §4.2.2.1][rfc6960-section-4.2.2.1] allows.
194
+ - `CreatePkcs12MacDataErrorCode` (`invalid_iterations`,
195
+ `password_not_bmp_string`, `password_not_utf8`) is exported from `micro509`
196
+ and `micro509/pkcs`. `createPkcs12MacData`, and `createPfx` through `mac`,
197
+ throw these codes as a `ResultError`.
198
+
199
+ - [RFC 4985 §4][rfc4985-section-4] SRVName name constraints. `NameConstraintForm` gains
200
+ `{ type: 'srv', value }`, whose value is `_Service.Name`, `_Service`, or
201
+ `Name`. The builder writes it as an id-on-dnsSRV otherName with the Name in
202
+ A-labels and refuses any other shape (`invalid_srv_name_constraint`);
203
+ parsing decodes an id-on-dnsSRV otherName base to it, and it is accepted as
204
+ an initial constraint. Path validation matches a SRVName SAN's service
205
+ case-insensitively and its Name as that domain or a subdomain, both parts
206
+ when the restriction has both. While a SRVName constraint is in force, a
207
+ SRVName SAN that is not `_Service.Name` fails, and a malformed restriction
208
+ fails every SRVName. Every SRVName, typed or received, is held to one
209
+ profile: an [RFC 6335 §5.1][rfc6335-section-5.1] service name and a Name of STD3 LDH labels with
210
+ IDNA2008 A-labels. The builder stores U+3002, U+FF0E and U+FF61 as "."
211
+ ([RFC 4985 §3][rfc4985-section-3]), in SANs, restrictions and initial constraints. A Name may
212
+ end in the root dot of an absolute name. It is kept as written, and
213
+ restriction matching compares its labels without the root label ([RFC 3490
214
+ §2][rfc3490-section-2], [§3.1][rfc3490-section-3.1]).
215
+ - `SubjectAltName` gains `otherName` (`typeId` and the DER of its value),
216
+ `x400Address`, `ediPartyName` (content octets), and `registeredID`
217
+ (dotted OID). Parsing produces them where it produced `unknown`, and the
218
+ builder encodes them; an `otherName` with the SRVName or SmtpUTF8Mailbox
219
+ type-id is refused (`other_name_type_id_has_variant`), as is a value that is
220
+ not one DER element or holds, at any depth, a universal-class element whose
221
+ form or contents break X.690 or whose rules micro509 cannot check, or a SET
222
+ or SET OF whose children follow neither DER order
223
+ (`invalid_other_name_value`). `x400Address` contents must follow the [RFC
224
+ 5280 Appendix A.1][rfc5280-appendix-A.1] ORAddress schema and `ediPartyName` contents the
225
+ EDIPartyName, with each DirectoryString validated by its encoding
226
+ (`invalid_general_name_content`); TeletexString, the Teletex and
227
+ extended-network-address extension attributes, and extension-attribute
228
+ types [RFC 5280][rfc5280] does not define are refused as unsupported. A value or
229
+ contents nested deeper than 64 levels throw `limit_exceeded`. `unknown`
230
+ remains as raw builder input.
231
+ - TeletexString Name attribute values decode in certificate, CRL, OCSP and
232
+ PKCS #7 names and in `decodeDerString`, which refused them before. Decoding
233
+ follows the initial state X.690 §8.23.5.2 fixes: the T.61 primary set
234
+ (register entry 102) with SPACE and DELETE, reading 2/3 as # and 2/4 as ¤
235
+ (T.61 Figure 2 Note 4). A C0 control function, an escape or shift sequence,
236
+ a position T.61 Table 1 leaves empty, or an octet from 0x80 up is
237
+ unsupported and returns `unsupported`. A decoded TeletexString value compares
238
+ like the other DirectoryString alternatives, after [RFC 4518][rfc4518] preparation ([RFC
239
+ 5280 §7.1][rfc5280-section-7.1]), so it matches a UTF8String or PrintableString value with the same
240
+ characters in issuer/subject chaining, CRL and OCSP issuer matching and
241
+ directoryName name constraints, with case and insignificant spaces
242
+ disregarded.
243
+ - `unsupported` and `limit_exceeded` on the parse error codes. `unsupported`,
244
+ on `ParseCertificateErrorCode`, `ParseCertificateSigningRequestErrorCode`,
245
+ `ParseCertificateRevocationListErrorCode`, `ParseOcspRequestErrorCode`,
246
+ `ParseOcspResponseErrorCode`, `ParsePkcs7ErrorCode`, `ParsePfxErrorCode` and
247
+ `DecodeDerErrorCode`, is input the profile may allow but micro509 does not
248
+ decode, today a TeletexString octet outside the X.690 §8.23.5.2 initial
249
+ state. `limit_exceeded`, on those and on `ImportKeyErrorCode`,
250
+ `ImportEncryptedKeyErrorCode`, `ParsePfxErrorCode` and
251
+ `ParsePkcs12MacDataErrorCode`, is an implementation limit of micro509's own:
252
+ an OBJECT IDENTIFIER sub-identifier encoded in more than 64 octets, a tag
253
+ number of 2^53 or more, or DER or BER nested deeper than 64 levels, which
254
+ returned `malformed` before. The
255
+ throwing parsers throw a `ResultError` carrying the code.
256
+ `DECODE_REFUSAL_CODES`, its `DecodeRefusalCode` type and `DecodeFailureCode`
257
+ (`malformed` plus both) are exported from `micro509` and `micro509/result`,
258
+ and each of those error code types is built from them.
259
+ `VERIFY_ERROR_CODES`, `MatchServiceIdentityErrorCode` and the
260
+ `verifyCertificateSigningRequest` and `checkExtendedKeyUsage` failures carry
261
+ both codes too, so a certificate or CSR source that `buildCandidatePath`,
262
+ `validateCandidatePath`, `verifyCertificateChain`, the `validateFor*`
263
+ profiles or `matchServiceIdentity` cannot decode reports its refusal, and
264
+ `trustAnchorFromCertificate` throws it. `validateCandidatePath` and
265
+ `checkExtendedKeyUsage` report it at the index of the chain element they
266
+ cannot decode. An `intermediates` or `roots` entry that `buildCandidatePath`
267
+ or `verifyCertificateChain` cannot load has no chain index, so its refusal,
268
+ or its `issuer_not_found` when malformed, names the entry in the new
269
+ `details.source` (`VerifyFailureSource`). A directoryName name constraint that
270
+ micro509 cannot decode fails the chain with its refusal at the index of the
271
+ certificate checked against it. The same holds for
272
+ `MatchCertificatePrivateKeyErrorCode`,
273
+ `CheckCertificateRevocationAgainstCrlErrorCode`,
274
+ `ValidateOcspResponseErrorCode`, `CheckCertificateRevocationErrorCode`,
275
+ `RevocationIndeterminateReasonCode`, `CreatePkcs7CertBagErrorCode`,
276
+ `CreatePkcs7SignedDataErrorCode` and the
277
+ `verifyCertificateRevocationListSignature`,
278
+ `validateCertificateRevocationList` and `verifyOcspResponseSignature`
279
+ failures, where a CRL, OCSP response or request, or certificate that
280
+ micro509 cannot decode was reported as `signature_invalid`,
281
+ `non_applicable`, `request_mismatch`, `malformed_certificate`,
282
+ `invalid_certificate` or `invalid_signer_certificate`. A
283
+ distribution point, issuing distribution point or CRL issuer directoryName
284
+ that micro509 cannot decode fails `checkCertificateRevocationAgainstCrl`
285
+ with its refusal. The chain level treats an OCSP refusal like the
286
+ `signature_invalid` it replaces. `checkChainRevocation` records a CRL or
287
+ OCSP response it cannot parse as a `RevocationParseError` whose `code` is
288
+ `malformed` or the refusal, and `RevocationExecutionError` is the union of
289
+ it and `RevocationProcessingError`.
290
+ - An OBJECT IDENTIFIER over the 64-octet limit inside RSASSA-PSS parameters
291
+ made the parameters `malformed`, so a certificate, CSR or CRL carrying them
292
+ parsed, and verifying it reported unsupported algorithm parameters. Parsing
293
+ now returns `limit_exceeded`, and
294
+ `verifySignature` returns it as the new `VerifySignatureLimitFailure`
295
+ (`VerifySignatureResult`), as it does for PKCS #1 or ECDSA parameters or a
296
+ signer SPKI past a decoding limit, which it reported as unsupported
297
+ parameters or a `verification_error`. A bare trust anchor whose SPKI is past
298
+ a decoding limit fails path validation with `limit_exceeded` rather than
299
+ `signature_invalid`. `verifyPkcs7SignedData` reports a refusal from
300
+ signature verification with its code instead of `malformed`.
301
+ - `rejectOversizedDisplayText` on `verifyCertificateChain` and
302
+ `validateCandidatePath` rejects a certificate whose user notice
303
+ `explicitText` or `noticeRef` organization exceeds 200 characters with the
304
+ new `display_text_oversized` verify code, which joins `VERIFY_ERROR_CODES`
305
+ with the character count in `details.actual` and the field in the new
306
+ `details.userNoticeField` (`'explicitText'` or `'noticeRefOrganization'`).
307
+ By default such a certificate validates, and its parsed user notice carries
308
+ `oversizedExplicitText`, or its `noticeRef` carries `oversizedOrganization`,
309
+ with the count (the new `OversizedDisplayText` type). [RFC 5280 §4.2.1.4][rfc5280-section-4.2.1.4] asks
310
+ certificate users to handle an oversized explicitText gracefully, and PKITS
311
+ 4.8.19 leaves rejection to the application. The RFC says nothing about an
312
+ oversized organization, and keeping it is micro509's receiving policy.
313
+ - URI-ID and SRV-ID matching accept a presented wildcard where [RFC 9525 §6.3][rfc9525-section-6.3]
314
+ allows one in the DNS domain name portion, such as `https://*.example.com/`
315
+ or `_imap.*.example.com`. It is the whole left-most label and matches one
316
+ label. A `sip` or `sips` URI-ID takes none ([RFC 5922 §7.2][rfc5922-section-7.2]).
317
+ - A URI-ID whose host is an IPv4 address or a bracketed IPv6 address matches
318
+ by its octets ([RFC 9525 §6.4][rfc9525-section-6.4]).
319
+
320
+ ### Changed
321
+
322
+ - **BREAKING** A CRLReason outside [RFC 5280 §5.3.1][rfc5280-section-5.3.1] parses as
323
+ `{ type: 'unrecognized', code }` (`UnrecognizedRevocationReason`) instead of
324
+ being dropped. `ParsedRevokedCertificate.reasonCode`, the revoked value of
325
+ `checkCertificateRevocationAgainstCrl`, `revocationReason` of
326
+ `checkCertificateRevocation`, the chain `revocationInfo.reason` and
327
+ `revocationReasonFromCode` use `ParsedRevocationReason`. A critical cRLReason
328
+ holding an unrecognized code makes the CRL `malformed`.
329
+ - **BREAKING** CRLReason codes decode as `bigint`, so a code of any length
330
+ parses. `UnrecognizedRevocationReason.code`, the OCSP
331
+ `revocationReasonCode` of `ParsedOcspCertStatus` and of the revoked value of
332
+ `checkCertificateRevocation`, and the argument of `revocationReasonFromCode`
333
+ are `bigint`. `createOcspResponse` still takes a `number`.
334
+ - A typed SRVName SAN outside the [RFC 6335][rfc6335] service grammar or STD3 LDH Name
335
+ syntax is refused with the new `invalid_srv_name`.
336
+ - A critical subjectAltName holding a SRVName that is not `_Service.Name`
337
+ under that profile, or a SmtpUTF8Mailbox that holds a Byte Order Mark or
338
+ lacks a non-ASCII [RFC 6531][rfc6531] Local-part and a domain of NR-LDH labels and
339
+ A-labels, carries information
340
+ path validation cannot process ([RFC 5280 §4.2][rfc5280-section-4.2]), and the chain fails with
341
+ `unrecognized_critical_extension`.
342
+ - SRV-ID matching compares the Name of the reference identifier and of each
343
+ presented SRVName without the root label, so `_imaps.example.com.` and
344
+ `_imaps.example.com` match ([RFC 3490 §2][rfc3490-section-2], [§3.1][rfc3490-section-3.1]). A Name with an empty label,
345
+ a repeated terminal dot or no labels still matches nothing.
346
+ - SRV-ID matching holds the reference identifier and each presented SRVName
347
+ to the [RFC 6335 §5.1][rfc6335-section-5.1] service name and STD3 LDH labels that the builder and
348
+ name constraints already enforce. A reference such as
349
+ `_123.example.com` or `_mail.example_com` is malformed input, and a presented
350
+ SRVName outside the grammar matches nothing.
351
+ - A critical `otherName` name constraint fails closed only for SANs of the
352
+ same type-id, following X.509 §9.4.2.2, where each type-id is its own name
353
+ form. A UPN constraint no longer rejects a SRVName or SmtpUTF8Mailbox SAN,
354
+ and a certificate carrying a UPN still fails under it. The
355
+ `unsupported_name_constraints` detail names the type-id
356
+ (`otherName 1.3.6.1.4.1.311.20.2.3`). An `otherName` constraint base is
357
+ decoded into `typeId` and `value`, and a malformed one fails the parse.
358
+ - A `registeredID` GeneralName whose OID is malformed fails the parse, in a
359
+ certificate and in a CRL. A critical subjectAltName carrying a
360
+ `registeredID` is processed rather than reported as an
361
+ `unrecognized_critical_extension`; a critical `registeredID` name
362
+ constraint still fails closed.
363
+ - A reference identifier's domain converts to A-labels by IDNA2008 lookup
364
+ after [RFC 5895][rfc5895] mapping ([RFC 9525 §6.3][rfc9525-section-6.3]), replacing the URL parser's UTS #46
365
+ processing. The mapping follows [RFC 5895 §2][rfc5895-section-2] in order: each character to its
366
+ Lowercase_Mapping, `<wide>` and `<narrow>` characters to their
367
+ decompositions from the Unicode 12.0.0 UCD, NFC, and U+3002 to ".". A
368
+ reference that IDNA2008 disallows, such as `♚.example`, or with an ASCII
369
+ label outside letters, digits, hyphens and underscores, matches nothing. A
370
+ trailing root dot is kept. The host of a URI-ID and of a presented URI
371
+ decodes its percent-encoded UTF-8 once before conversion ([RFC 3986 §3.2.2][rfc3986-section-3.2.2]),
372
+ and a malformed encoding matches nothing.
373
+ - An rfc822Name name constraint that names a particular mailbox
374
+ (`user@example.com`) is refused: the builder throws
375
+ `email_name_constraint_names_mailbox`, and a caller-supplied initial
376
+ constraint fails with `unsupported_initial_name_constraints`. [RFC 9549 §2.2][rfc9549-section-2.2]
377
+ removed that form. A certificate issued with one still validates as before.
378
+ - `initialPolicySet` canonicalizes every OID. A list holding the anyPolicy OID
379
+ means `'any'`, and a list with a malformed OID matches no policy.
380
+ - npm and JSR packages include `CHANGELOG.md` in the published tarball
381
+ (`package.json` `files`, `jsr.json` `publish.include`).
382
+ - `trustedOcspResponders` on `checkChainRevocation()` and
383
+ `verifyCertificateChain({ revocation })` takes `TrustedOcspResponder`
384
+ entries (`{ issuerCertificate, responderCertificate }`) instead of bare
385
+ certificates. See Security.
386
+ - **BREAKING** `createCertificateRevocationList` requires `nextUpdate` and
387
+ always encodes it ([RFC 5280 §5.1.2.5][rfc5280-section-5.1.2.5]). It throws `ResultError` code
388
+ `next_update_not_after_this_update` when `nextUpdate` does not encode a later
389
+ second than `thisUpdate`, which defaults to now. This ordering is a micro509
390
+ builder invariant. `CrlEncoderErrorCode` gains
391
+ `next_update_not_after_this_update`. Parsed CRLs keep `nextUpdate` optional.
392
+ - **BREAKING** `createCertificateRevocationList` requires `issuerCertificate` and
393
+ `crlNumber` and always encodes the Authority Key Identifier and CRL Number
394
+ extensions ([RFC 5280 §5.2.1][rfc5280-section-5.2.1], [§5.2.3][rfc5280-section-5.2.3]).
395
+ - **BREAKING** CRL numbers are `bigint`. `crlNumber` and `baseCrlNumber` on
396
+ `createCertificateRevocationList` take a `number` or `bigint` up to 20
397
+ octets and throw `ResultError` code `crl_number_invalid` past that, when
398
+ negative, or when not an integer. `ParsedCertificateRevocationList.crlNumber`
399
+ and `baseCrlNumber` are `bigint`. Parsing failed on any CRL number above
400
+ 2^53 − 1, though [RFC 5280 §5.2.3][rfc5280-section-5.2.3] requires verifiers to handle 20 octets, and
401
+ read a CRLNumber of another ASN.1 type as an INTEGER. It now refuses the
402
+ latter as malformed.
403
+ - CRL parsing refuses trailing data after a CRLNumber, deltaCRLIndicator,
404
+ cRLReason or invalidityDate value, and requires cRLReason to be a minimal,
405
+ non-negative ENUMERATED ([RFC 5280 §5.3.1][rfc5280-section-5.3.1]). It read
406
+ the first content octet of any element as the reason code.
407
+ - **BREAKING** `createCertificate` takes `issuerCertificate` (PEM, DER or a
408
+ parsed certificate) in place of `issuerPublicKey`, and both builders copy
409
+ that certificate's subject key identifier into the authority key identifier
410
+ ([RFC 5280 §4.2.1.2][rfc5280-section-4.2.1.2], [§5.2.1][rfc5280-section-5.2.1]). They derived it from the issuer key
411
+ by method (1) before, so an issuer whose subject key identifier came from
412
+ another method got certificates and CRLs whose authority key identifier
413
+ matched nothing, and `validateCertificateRevocationList` refused those CRLs
414
+ with `issuer_mismatch`. An issuer certificate without a subject key
415
+ identifier gets a method (1) identifier over its public key. An
416
+ `issuerCertificate` that does not parse throws `ResultError` code
417
+ `issuer_certificate_invalid`, which `CreateCertificateErrorCode` and
418
+ `CrlEncoderErrorCode` gain.
419
+ - An [RFC 7292][rfc7292] MAC password containing a UTF-16 surrogate (a non-BMP character
420
+ or a lone surrogate), U+FFFE or U+FFFF is not a BMPString ([RFC 7292 Appendix
421
+ B.1][rfc7292-appendix-B.1], X.680 §41.15).
422
+ `createPkcs12MacData` and `createPfx` throw `ResultError` code
423
+ `password_not_bmp_string` for it, and `parsePkcs12MacData`, `parsePfxDer`
424
+ and `parsePfxPem` return that code. `parsePfxDer` and `parsePfxPem` reported
425
+ it as `malformed` before.
426
+ - A PFX MAC with a digest other than SHA-256 returns
427
+ `unsupported_mac_algorithm` instead of `malformed`.
428
+ - `parsePfxDer` and `parsePfxPem` accept BER for the PFX, the authSafe
429
+ ContentInfo, the AuthenticatedSafe and each SafeContents: indefinite lengths,
430
+ non-minimal lengths and constructed OCTET STRINGs ([RFC 7292 §4][rfc7292-section-4]). The MAC is
431
+ verified over the AuthenticatedSafe octets as received. Certificates and
432
+ PKCS#8 keys inside bags must still be DER. BER nesting is limited to 64
433
+ levels. `ParsedPfxAttribute.valuesHex` and the unknown bag's `valueDer` hold
434
+ the received value with definite lengths and universal constructed strings
435
+ joined, so they are not guaranteed to be DER.
436
+ - A presented URI-ID whose host is a percent-encoded U-label, such as
437
+ `https://b%C3%BCcher.example/`, no longer matches the reference
438
+ `https://xn--bcher-kva.example/`. [RFC 9525 §2][rfc9525-section-2] requires A-labels in the DNS
439
+ domain name portion of a URI-ID, and [RFC 3986 §6][rfc3986-section-6] decodes only percent-encoded
440
+ unreserved characters. A reference URI-ID's host still decodes as UTF-8
441
+ and converts to A-labels ([RFC 9525 §6.3][rfc9525-section-6.3]).
442
+
443
+ ### Fixed
444
+
445
+ - `createOcspResponse` wrote `revocationReasonCode` as a single octet, so a code
446
+ of 128 or more became a negative or truncated ENUMERATED. It now encodes the
447
+ minimal DER ENUMERATED and throws `ResultError` code
448
+ `invalid_revocation_reason_code` for a negative or non-integer code.
449
+ - CRL parsing accepted a revoked entry carrying a critical extension other
450
+ than reasonCode, invalidityDate or certificateIssuer. [RFC 5280 §5.3][rfc5280-section-5.3]
451
+ forbids using such a CRL for any certificate, and parsing now refuses it as
452
+ `malformed`.
453
+ - Key import returned `malformed` for a decode limit inside a
454
+ SubjectPublicKeyInfo, PKCS#8, SEC 1 or EncryptedPrivateKeyInfo, and
455
+ `invalid_password` for one inside decrypted PKCS#8, PKCS#1 or SEC 1 content.
456
+ `verifyPkcs7SignedData` returned `malformed` for one inside signedAttrs.
457
+ They now return `limit_exceeded`.
458
+ - PFX parsing accepted any context-specific constructed tag where ContentInfo
459
+ content, SafeBag bagValue and CertBag certValue are `[0] EXPLICIT`. Any
460
+ other tag is now `malformed`.
461
+ - A BER implementation limit inside decrypted PFX SafeContents returned
462
+ `invalid_password`. It now returns `limit_exceeded`.
463
+ - Policy validation applied a policyMappings extension found in the
464
+ end-entity certificate. [RFC 5280 §6.1.3][rfc5280-section-6.1.3] runs the policy-mapping step of
465
+ [§6.1.4][rfc5280-section-6.1.4] only for certificates before the last, and [RFC 9618][rfc9618] keeps that, so a
466
+ leaf's mappings no longer rewrite or, under inhibitPolicyMapping, delete the
467
+ policies that certificate asserts.
468
+ - The certificate builder accepted a `customExtensions` certificatePolicies
469
+ payload whose user notice `explicitText` was an IA5String, which [RFC 6818 §3][rfc6818-section-3]
470
+ forbids for conforming CAs. `explicitText` now follows [RFC 6818 §3][rfc6818-section-3] on both
471
+ builder paths: IA5String fails with `display_text_ia5_string`, control
472
+ characters with `display_text_control_character`, and UTF8String or
473
+ BMPString text outside Unicode NFC with `display_text_not_nfc`. A user notice
474
+ gains `explicitTextType`, which parsing sets to the received string type and
475
+ which the builder accepts as `'visibleString'` or `'bmpString'` (default
476
+ `'utf8String'`), failing with `invalid_visible_string` or
477
+ `invalid_bmp_string` when the text does not fit.
478
+ - Two `site/guide/keys.md` LiveCode examples used TypeScript parameter types
479
+ (`key: CryptoKey`, `bytes: Uint8Array`). LiveCode injects examples as browser
480
+ JS modules, so Run failed with `missing ) after argument list` and
481
+ `Unexpected token ':'`. The annotations are removed.
482
+ - PBES2 parsing (encrypted PKCS#8 import and inspection, PFX key bags) rejects
483
+ a PBKDF2 `iterationCount` that is not an INTEGER.
484
+ (https://github.com/kjanat/micro509/pull/113)
485
+ - A PBKDF2 `iterationCount` above 4294967295 returns `malformed`. Before, with
486
+ `maxKdfIterations` set above 2^32, it reached WebCrypto and threw an uncaught
487
+ `TypeError` from a Result-returning import.
488
+ - `exportEncryptedPkcs8Der` / `exportEncryptedPkcs8Pem` and PFX creation throw
489
+ `RangeError` for `iterations` above 4294967295, which previously passed
490
+ validation.
491
+ - An [RFC 7292][rfc7292] MacData iteration count of 2^53 or more returns
492
+ `kdf_iterations_exceeded` when a password is given. Without a password it
493
+ returns `malformed`.
494
+ - Chain evaluation applied the first delta CRL whose base CRL number matched,
495
+ even an expired one. It now uses only a current delta (the evaluation time
496
+ lies between its `thisUpdate` and `nextUpdate`) whose CRL number exceeds the
497
+ base CRL's number, and it prefers the one with the latest `thisUpdate` ([RFC
498
+ 5280 §5.2.4][rfc5280-section-5.2.4]), then the higher CRL number when two share a `thisUpdate` second
499
+ ([§5.2.3][rfc5280-section-5.2.3]). The delta's `thisUpdate` must also be no earlier than the base
500
+ CRL's (X.509 Annex E.5.2), and an equal `thisUpdate` is accepted.
501
+ `checkCertificateRevocationAgainstCrl` returns `non_applicable` with reason
502
+ `delta_crl_incompatible` for a delta whose `thisUpdate` precedes the complete
503
+ CRL's (X.509 Annex E.5.2).
504
+ - The CRL issuingDistributionPoint decoder read any non-zero BOOLEAN octet as
505
+ TRUE and empty content as FALSE. A BOOLEAN whose content is not a single
506
+ `0x00` or `0xFF` octet is now `malformed` (X.690 §11.1).
507
+ - An invalid `Date` passed to `createCertificate`, `createSelfSignedCertificate`,
508
+ `createCertificateRevocationList` or `createOcspResponse` compared as `NaN`,
509
+ skipped the ordering checks and surfaced as an uncoded `RangeError` from the
510
+ DER encoder. `CreateCertificateErrorCode` gains `validity_date_invalid`, and
511
+ `CrlEncoderErrorCode` and `OcspEncoderErrorCode` gain `invalid_date`, thrown
512
+ as a `ResultError` before encoding.
513
+ - Decoding ASN.1 text dropped a leading U+FEFF as a byte order mark. A UTCTime
514
+ or GeneralizedTime whose contents began with the octets EF BB BF parsed as
515
+ the time that followed, in certificates, CRLs, OCSP responses and
516
+ `decodeDerTime`; it is now malformed. A UTF8String keeps the character in
517
+ `decodeDerString`, parsed names and DisplayText.
518
+ - BMPString decoding and `derBmpString` accepted U+FFFE and U+FFFF, which
519
+ X.680 §41.15 leaves out of BMPString. `decodeDerString` and name parsing now
520
+ reject them as they reject surrogates, `derBmpString` throws, and a BMPString
521
+ explicitText holding one fails with `invalid_bmp_string`.
522
+ - OBJECT IDENTIFIER decoding refused any arc above 2^53 − 1, so a certificate
523
+ or CRL carrying a 2.25 UUID OID failed to parse, and the builder refused such
524
+ an OID with `invalid_oid`. Arcs now decode, encode and canonicalize exactly
525
+ up to 64 octets per sub-identifier (values below 2^448). X.660 §7.6 leaves
526
+ arcs unbounded; the bound is an implementation limit, checked before the arc
527
+ is accumulated, since decoding grew quadratically with an arc's length. A
528
+ longer arc returns `limit_exceeded` from every parser and from the builder,
529
+ which checks each arc's decimal length before it builds the arc and adds the
530
+ code to `ExtensionEncoderErrorCode`.
531
+ - `createPfx` wrote any `friendlyName` into its BMPString, including surrogate
532
+ pairs, U+FFFE, U+FFFF, an empty name and names over 255 characters, and PFX
533
+ parsing accepted them. [RFC 2985 §5.5.1][rfc2985-page-17] makes friendlyName one BMPString of 1
534
+ to 255 characters. `createPfx` now throws `ResultError` code
535
+ `invalid_friendly_name` from the new `PfxEncoderErrorCode`, and parsing
536
+ returns `malformed`.
537
+ - DisplayText parsing (user-notice `explicitText` and the `noticeRef`
538
+ organization) replaced invalid UTF-8 with U+FFFD, accepted octets outside
539
+ the IA5String and VisibleString repertoires, and accepted any length. It now
540
+ decodes the tagged type strictly. An empty DisplayText and any other
541
+ encoding return `malformed`. An `explicitText` over 200 characters, such as
542
+ PKITS 4.8.19's, is kept whole and reported as `oversizedExplicitText`, and
543
+ an organization over 200 characters as `oversizedOrganization`. See Added.
544
+ - CRL issuer and PKCS #7 signer issuer parsing decoded an attribute value that
545
+ failed its string type's decoding as UTF-8 and replaced invalid sequences
546
+ with U+FFFD. Such a value now returns `malformed`, as it does in a
547
+ certificate.
548
+ - A UTF8String the builder wrote from a string holding a lone UTF-16
549
+ surrogate carried U+FFFD in its place, so the certificate held different
550
+ text from the input. A lone surrogate in a name attribute now fails with the
551
+ new `name_attribute_lone_surrogate`, and in an explicitText or `noticeRef`
552
+ organization with the new `display_text_lone_surrogate`. A surrogate pair
553
+ and U+FFFD itself encode as before.
554
+
555
+ ### Security
556
+
557
+ - Under `unrecognizedReasonCode: 'reject'`, a CRL with an unrecognized reason
558
+ affects the chain verdict only after its signer is authorized and its
559
+ revocation status is checked. An untrusted signer supplied through
560
+ `extraCertificates` can no longer make trusted good evidence indeterminate.
561
+ - **BREAKING** A complete CRL without `nextUpdate` stayed usable for any
562
+ evaluation time after its `thisUpdate` unless the caller set a maximum age,
563
+ so a replayed CRL from before a revocation reported the certificate `good`.
564
+ `validateCertificateRevocationList` and `checkCertificateRevocationAgainstCrl`
565
+ now fail it with `stale_crl` unless `maxAgeMs` is set, and chain revocation
566
+ takes no evidence from it unless `crlMaxAgeMs` is set, for chain
567
+ certificates, CRL signers and delegated OCSP responders alike. When set, that
568
+ bound governs the CRL. A delta CRL without `nextUpdate` is refused as before.
569
+ - A received dNSName or rfc822Name ending in the root dot, such as
570
+ `evil.example.com.`, matched no dNSName or rfc822Name constraint, so an
571
+ excluded `example.com` did not exclude it. While constraints of its type are
572
+ in force, such a name now fails with `name_constraints_violated`, and an
573
+ initial dNSName or rfc822Name constraint ending in the root dot returns
574
+ `unsupported_initial_name_constraints`.
575
+ - Chain-level revocation skipped a certificate carrying `id-pkix-ocsp-nocheck`
576
+ whatever the extension held, and `hasOcspNoCheckExtension` counted it the
577
+ same way. Only the NULL value [RFC 6960 §4.2.2.2.1][rfc6960-section-4.2.2.2.1] defines now counts.
578
+ - DNS service-identity matching ran the certificate's dNSName through the URL
579
+ parser, which percent-decodes and parses IPv4 forms, so a SAN such as
580
+ `a%62c.example` matched the reference `abc.example` and `0x7f.0.0.1` matched
581
+ `127.0.0.1`. A presented dNSName, and the Common Name fallback, now compare
582
+ by a case-insensitive exact match ([RFC 9549 §2.3][rfc9549-section-2.3]).
583
+ - A directoryName name constraint whose DN could not be decoded matched no
584
+ name, so an excluded subtree excluded nothing. While one is in force, every
585
+ subject DN and directoryName SAN fails with `name_constraints_violated`.
586
+ - A directoryName comparison that [RFC 4518][rfc4518] string preparation cannot perform,
587
+ such as one over a value holding a private-use character, counted as a
588
+ mismatch, so an excluded subtree did not exclude the name. Such a comparison
589
+ is now Undefined. It fails an excluded subtree and does not satisfy a
590
+ permitted one. A multi-valued RDN matches when some one-to-one pairing of
591
+ its attributes matches every pair, and is Undefined when no such pairing
592
+ exists but one does with Undefined pairs allowed, whatever order its
593
+ attributes take. Matching an RDN takes time linear in its attribute count,
594
+ in CRL distribution point names too.
595
+ - URI name constraints and URI-ID matching read a URI SAN's host differently.
596
+ The constraint took the WHATWG URL hostname, which left
597
+ `ldap://%62locked.example/` percent-encoded and kept the trailing dot of
598
+ `https://blocked.example./`, so both escaped a `blocked.example` exclusion,
599
+ and the first still matched the URI-ID `ldap://blocked.example/`. URI-ID
600
+ matching cut every host at ";", so `https://blocked.example;extra/` matched
601
+ `https://blocked.example/`, and kept the trailing dot, so
602
+ `https://blocked.example./` did not. Both now read the host by [RFC 3986][rfc3986]:
603
+ a percent-encoded unreserved character decodes, the dot after the rightmost
604
+ label is dropped, and a reg-name that is not a domain name after decoding,
605
+ a percent-encoded U-label included, fails every URI constraint and matches
606
+ no URI-ID.
607
+ - A SIP or SIPS URI-ID was cut at "/", "?" or "#" before its userinfo "@"
608
+ was found, so `sip:alice/phone@attacker.example` took the host `alice` and
609
+ matched `sip:alice/phone@victim.example`. The host now follows the one "@"
610
+ [RFC 3261 §25.1][rfc3261-section-25.1] allows and ends at the first ";" or "?". A second "@", an
611
+ empty user part, a "/" in the hostport, or a ":" with no port digits after
612
+ it makes the URI-ID invalid, and so does a `sip://` or `sips://` URI-ID,
613
+ which [§25.1][rfc3261-section-25.1] does not allow.
614
+ - A presented SIP URI with a userinfo, such as `sip:alice@example.com`,
615
+ matched the URI-ID `sip:example.com`. It identifies a user, and [RFC 5922
616
+ §7.1][rfc5922-section-7.1] forbids accepting it as a SIP domain identity, so it now matches
617
+ nothing. A reference identifier may still carry a userinfo, and only its
618
+ host is compared ([RFC 5922 §7.3][rfc5922-section-7.3]).
619
+ - A URI's userinfo was dropped unread, so a presented
620
+ `https://bad%zz@example.com` took the host `example.com`, matched the
621
+ URI-ID `https://example.com`, and was evaluated against URI constraints.
622
+ A userinfo outside [RFC 3986 §3.2.1][rfc3986-section-3.2.1], or for `sip` and `sips` outside the
623
+ [RFC 3261 §25.1][rfc3261-section-25.1] user and password, now makes the host invalid. A reference
624
+ identifier's userinfo follows [RFC 3987 §2.2][rfc3987-section-2.2] `iuserinfo`.
625
+ - The path, query and fragment of a URI-ID or URI SAN, and the parameters
626
+ and headers of a SIP URI-ID, were never read, so `https://example.com/%zz`
627
+ and `sip:victim.example;%zz` matched the URI-IDs `https://example.com/` and
628
+ `sip:victim.example`, and the first was evaluated against URI constraints.
629
+ They must now follow [RFC 3986 §3.3][rfc3986-section-3.3] to [§3.5][rfc3986-section-3.5], [RFC 3987 §2.2][rfc3987-section-2.2] for a reference
630
+ identifier, and the [RFC 3261 §25.1][rfc3261-section-25.1] uri-parameters and headers, with every
631
+ "%" opening an escaped octet and no SIP parameter name repeated. A SIP host
632
+ must be a [§25.1][rfc3261-section-25.1] hostname or an IP address.
633
+ - A URI name constraint that was not a DNS name, such as
634
+ `https://blocked.example`, matched no host, so an excluded subtree excluded
635
+ nothing. The builder refuses it with the new `invalid_uri_name_constraint`,
636
+ initial constraints return `unsupported_initial_name_constraints`, and while
637
+ a received one is in force every URI SAN fails with
638
+ `name_constraints_violated`.
639
+ - A dNSName or rfc822Name name constraint whose domain is malformed, such as
640
+ `.example.com.`, matched no name, so an excluded subtree excluded nothing.
641
+ While one is in force, every dNSName, rfc822Name or SmtpUTF8Mailbox of its
642
+ type now fails with `name_constraints_violated`.
643
+ - Caller-supplied initial name constraints accepted a dNSName, rfc822Name or
644
+ URI base written with U-labels. Certificates carry A-labels ([RFC 9549 §1][rfc9549-section-1]),
645
+ so such a base never matched, and an excluded subtree excluded nothing. A
646
+ dNSName or rfc822Name base now converts to A-labels, and a URI base or a
647
+ domain that is not valid IDNA2008 fails with
648
+ `unsupported_initial_name_constraints`.
649
+ - A SmtpUTF8Mailbox subjectAltName ([RFC 9598][rfc9598]) parsed as an unrecognized
650
+ otherName, so rfc822Name name constraints never reached it and an
651
+ internationalized mailbox outside a permitted domain, or inside an excluded
652
+ one, passed path validation. It now parses as
653
+ `{ type: 'smtpUtf8Mailbox', value }` and rfc822Name constraints bind it by
654
+ domain ([RFC 9598 §6][rfc9598-section-6]). A received mailbox fails whenever rfc822Name
655
+ constraints apply unless it holds no Byte Order Mark, its Local-part is a
656
+ non-ASCII [RFC 6531][rfc6531] Local-part, and its domain is NR-LDH labels and A-labels
657
+ that pass the [RFC 5893][rfc5893] Bidi rule. The builder emits
658
+ it and enforces [RFC 9598 §3][rfc9598-section-3]: `invalid_smtp_utf8_mailbox` for a missing `@`,
659
+ a Byte Order Mark, a Local-part outside the [RFC 6531][rfc6531] Dot-string or
660
+ Quoted-string grammar, or a domain that is not lowercase NR-LDH labels and
661
+ A-labels, and `smtp_utf8_mailbox_ascii_local_part` for a Local-part that
662
+ fits an rfc822Name. A U-label domain is stored as A-labels, and a
663
+ `customExtensions` SAN or IAN whose mailbox domain is not already stored
664
+ that way fails with `invalid_smtp_utf8_mailbox`.
665
+ - CRL validation accepted a v3 issuer certificate with no keyUsage extension,
666
+ so a CRL signed with a key certified for another purpose under the CRL
667
+ issuer's name validated. A v3 CRL issuer certificate now needs keyUsage with
668
+ `cRLSign`, and fails with `crl_sign_not_permitted` without it; v1 and v2
669
+ issuer certificates have no extensions and skip the check ([RFC 10007 §4][rfc10007-section-4]).
670
+ - Chain-level CRL evaluation picked one delta CRL per base CRL from its
671
+ unauthenticated `thisUpdate` and CRL number, and when that delta failed
672
+ validation it tried neither another delta nor the base CRL alone. A forged
673
+ delta with a later `thisUpdate` therefore hid an authentic revoking delta,
674
+ or a revocation listed in the base CRL itself, and a validated OCSP `good`
675
+ then allowed the revoked certificate under hard-fail. Applicable deltas are
676
+ now tried newest first, and the base CRL is evaluated alone once every delta
677
+ fails authentication, freshness, compatibility or applicability. A delta
678
+ that passes those checks but whose revoked entries cannot settle the status
679
+ makes the result indeterminate with the new reason `delta_crl_unusable`. At
680
+ most four deltas are checked per base CRL and 32 per call, skipping base
681
+ CRLs that do not cover the certificate and repeated copies of a CRL, and
682
+ a delta left unchecked makes the result indeterminate with the new reason
683
+ `delta_crl_retry_limit_exceeded`. Either reason outranks a `good` verdict
684
+ from OCSP or another CRL. Chain evaluation now reads a pre-parsed CRL from
685
+ its `der`, as `checkCertificateRevocationAgainstCrl` does, and reports one
686
+ without `der` in `executionErrors`. Neither delta reason replaces a
687
+ revocation that the base CRL lists for a reason other than
688
+ `certificateHold`, since no delta can remove it while the certificate is
689
+ unexpired ([RFC 5280 §5.3.1][rfc5280-section-5.3.1]).
690
+ - Decoding a DER INTEGER above `Number.MAX_SAFE_INTEGER`, such as a PKCS#12
691
+ MacData or PBMAC1 iteration count, folded every octet into a `bigint`, so a
692
+ file with a very long INTEGER cost CPU and memory before the KDF budget could
693
+ reject it. Decoding now stops at the first octet past the safe range.
694
+ - Chain-level OCSP evaluation returned on the first validated `good` response,
695
+ so a `revoked` response later in `ocspResponses` was never read and a
696
+ revoked certificate passed with `decision: 'allow'`. Every applicable
697
+ response is now validated; any validated `revoked` verdict wins regardless
698
+ of position, and otherwise the freshest validated `good` response by
699
+ `thisUpdate` is reported. A `certificateHold` ([RFC 5280 §5.3.1][rfc5280-section-5.3.1] reason 6)
700
+ still denies unless a validated `good` response carries a later
701
+ `thisUpdate`, which clears the hold.
702
+ (https://github.com/kjanat/micro509/pull/108,
703
+ https://github.com/kjanat/micro509/pull/110)
704
+ - `trustedOcspResponders` on chain-level revocation was a flat list applied to
705
+ every issuer in the chain, so a responder trusted for one CA could assert
706
+ status for certificates issued by any other CA in the same path ([RFC 6960
707
+ §4.2.2.2][rfc6960-section-4.2.2.2] criterion 1 binds local trust to the issuing CA). Each entry now
708
+ names the issuer it is trusted for, and only responders bound to the issuer
709
+ under evaluation reach `validateOcspResponse`.
710
+ (https://github.com/kjanat/micro509/pull/111)
711
+ - URI-ID matching accepted a scheme-specific path as an authority, so a
712
+ hostless SAN such as `https:verify.example` matched the reference identifier
713
+ `https://verify.example` in `verifyCertificateChain` and
714
+ `validateForTlsServer`. A URI now needs a syntactically valid scheme and an
715
+ explicit `//` authority ([RFC 3986 §3.2][rfc3986-section-3.2]), and its reg-name must normalize as a
716
+ DNS name; `sip:` and `sips:` keep their authority-less form ([RFC 3261 §19.1][rfc3261-section-19.1]).
717
+ (https://github.com/kjanat/micro509/pull/109)
718
+ - `ecdsaSignatureDerToRaw` and the ECDSA verify path trimmed leading zero
719
+ bytes from each `ECDSA-Sig-Value` INTEGER without checking the encoding, so
720
+ an empty, negative, or non-minimally encoded `r` or `s` (X.690 §8.3)
721
+ normalized into a raw signature WebCrypto could verify, giving a second
722
+ accepted encoding of one signature. Such INTEGERs are now rejected.
723
+ (https://github.com/kjanat/micro509/pull/100)
724
+ - `verifyPkcs7SignedData` reported `ok: true` for a `SignedData` whose
725
+ `signerInfos` set was empty, with embedded `eContent` or with detached
726
+ `content` from the caller, verifying nothing. A `SignedData` with no signer
727
+ now fails with `no_signers`, a new `VerifyPkcs7SignedDataErrorCode`.
728
+ (https://github.com/kjanat/micro509/pull/106)
729
+ - Distinguished-name comparison classified combining marks with the runtime's
730
+ `\p{M}`, which tracks the host Unicode version. [RFC 4518 §2.6.1][rfc4518-section-2.6.1] keys
731
+ insignificant-space handling on combining marks, and [Appendix A][rfc4518-appendix-A] lists them
732
+ definitively against the Unicode 3.2 repertoire [§2.1][rfc4518-section-2.1] fixes. A code point
733
+ reclassified since 3.2 (U+1885, U+06DE) changed which spaces survived, so a
734
+ directoryName excluded subtree could fail to match. The [Appendix A][rfc4518-appendix-A] set is
735
+ now generated from the vendored RFC text and guarded by a test that
736
+ re-derives it. (https://github.com/kjanat/micro509/pull/102)
737
+ - A caller-supplied extension decoder that threw a native error (for example
738
+ `TextDecoder` with `fatal: true` on invalid UTF-8) escaped the
739
+ Result-returning certificate and CSR parse functions as an exception. The
740
+ decoder boundary now maps such errors to `code: 'malformed'`, so attacker
741
+ bytes in an extension cannot crash a parser call.
742
+ (https://github.com/kjanat/micro509/pull/107)
743
+ - The `site/guide/revocation.md` CRL example looked up revoked entries after a
744
+ failed signature check. It now calls `validateCertificateRevocationList` and
745
+ reads entries only from the validated value.
746
+ (https://github.com/kjanat/micro509/pull/104)
747
+ - Third-party GitHub Actions in the release, test, and site workflows are
748
+ pinned to commit SHAs again; mutable tags had let upstream ref movement run
749
+ unreviewed code with `id-token: write` and `contents: write`.
750
+ (https://github.com/kjanat/micro509/pull/103)
751
+ - Encrypted PKCS#8 import and PFX parsing ran PBKDF2, and PFX MAC
752
+ verification ran the PKCS#12 KDF, for whatever iteration count the file
753
+ encoded before the password or ciphertext could be rejected. A 122-byte
754
+ EncryptedPrivateKeyInfo or a 177-byte PFX carrying `0x7fffffff` iterations
755
+ held the CPU for minutes. Counts above the ceiling are now refused before
756
+ derivation; `maxKdfIterations` adjusts it.
757
+ - A PFX gave every encrypted entry the full `maxKdfIterations` allowance, so a
758
+ file with many small entries could demand unbounded work without any encoded
759
+ count standing out: 100 entries at the default ceiling ask for 200 million
760
+ PBKDF2 rounds. One budget now covers the whole file.
761
+ - Bare trust anchors were re-verified on every visit to a certificate, because
762
+ the anchor match ran before the dead-end lookup. A bundle of same-subject CAs
763
+ plus a few subject-matching anchors made anchor signature checks grow with
764
+ the search graph rather than the input: 40 candidates and 20 anchors cost
765
+ 3.7s. Each certificate-and-anchor pair is now checked once per search.
766
+ - Path building memoized dead ends per visited set, so a bundle of `n`
767
+ same-subject CA certificates sharing one key cost on the order of `n³`
768
+ signature verifications before `no_trusted_root` (30 candidates: 9,426 key
769
+ imports and 18,852 verify calls). Dead ends are now memoized per certificate
770
+ and CA count, and each certificate-to-key signature check runs once per
771
+ search.
772
+ - The dprint TOML formatter installed `tombi` unversioned and globally from
773
+ npm on every fresh setup, so the registry chose the code that ran. `tombi`
774
+ is now a catalog-pinned devDependency; the exec plugin runs
775
+ `node_modules/.bin/tombi` and its setup command is `bun install`.
776
+ - The OpenSSL differential tests ran against whatever OpenSSL the runner image
777
+ shipped. CI now installs a pinned OpenSSL 4.0.2 from
778
+ `ghcr.io/kjanat/openssl-prebuilt`, verifies its build provenance
779
+ attestation, and fails unless `openssl version` reports 4.0.2, so an oracle
780
+ change surfaces as a version assertion instead of as verdict or formatting
781
+ drift. Usage of the public builds is documented in
782
+ [`.github/openssl`](https://github.com/kjanat/micro509/tree/master/.github/openssl#readme).
783
+
784
+ ## [0.14.0] - 2026-07-29
785
+
786
+ Everything that already worked but had no export: a `micro509/crypto`
787
+ entrypoint for detached signatures, extension decoders, [RFC 5280 §7.1][rfc5280-section-7.1]
788
+ distinguished-name comparison, PKCS#7 signer resolution, and PBES2
789
+ inspection. Plus three wrongful-acceptance fixes under Security and a
790
+ stricter typed-contract pass.
791
+
792
+ ### Added
793
+
794
+ - `ParsedCertificate.issuerAltNames` decodes the issuerAltName extension
795
+ ([RFC 5280 §4.2.1.7][rfc5280-section-4.2.1.7], OID 2.5.29.18) with the subjectAltName GeneralNames
796
+ decoder.
797
+ - `checkCertificateRevocationAgainstCrl` reports `coveredReasons` on a `good`
798
+ value: the [RFC 5280 §6.3.3][rfc5280-section-6.3.3] (d) interim_reasons_mask computed from the matched
799
+ distribution point's `reasons` and the CRL's `onlySomeReasons`.
800
+ - `verifyPkcs7SignedData` success values carry `signers`, pairing each
801
+ SignerInfo with the certificate that verified its signature
802
+ (`VerifiedPkcs7Signer`), so callers can check trust, EKU, or identity of the
803
+ actual signer without reimplementing the issuerAndSerial DN match.
804
+ (https://github.com/kjanat/micro509/issues/67)
805
+ - `micro509/crypto`, a new entrypoint for detached signatures: `verifySignature`
806
+ checks raw bytes against a signer's SubjectPublicKeyInfo across RSA PKCS#1
807
+ v1.5, RSA-PSS, ECDSA P-256/P-384/P-521, and Ed25519, retrying the alternate
808
+ DER/raw ECDSA encoding; `signData` signs with a WebCrypto key and returns the
809
+ signature beside its `AlgorithmIdentifier` material; `ecdsaSignatureDerToRaw`
810
+ and `ecdsaSignatureRawToDer` convert between the DER `ECDSA-Sig-Value` X.509
811
+ and CMS embed and the raw `r || s` form WebCrypto and JOSE use.
812
+ (https://github.com/kjanat/micro509/issues/65)
813
+ - `micro509/x509` exports its extension-value decoders as the `decode*`
814
+ inverses of the existing encoders (`decodeKeyUsage`, `decodeBasicConstraints`,
815
+ `decodeSubjectAltNames`, …, `decodeAuthorityKeyIdentifier`), the [RFC 5280
816
+ §7.1][rfc5280-section-7.1] semantic DN comparison (`compareDistinguishedNames`, `canonicalDnKey`,
817
+ `isWithinDirectoryNameSubtree`), `parseDistinguishedNameDer` for a bare
818
+ `Name`, the `parseCertificateFromSource` / `parseCertificatesFromSource`
819
+ input normalizers, `subjectKeyIdentifier` ([RFC 5280 §4.2.1.2][rfc5280-section-4.2.1.2] method (1)),
820
+ and the IP helpers name-constraint inputs demand (`parseIpAddressToBytes`,
821
+ `decodeIpAddress`, `allOnesMaskForIpAddress`, `normalizeIpAddress`).
822
+ (https://github.com/kjanat/micro509/issues/64)
823
+ - `isSelfIssuedCertificate` from `micro509/verify`: the [RFC 5280 §7.1][rfc5280-section-7.1]
824
+ subject-equals-issuer predicate path validation already used internally.
825
+ (https://github.com/kjanat/micro509/issues/65)
826
+ - `inspectEncryptedPkcs8Der` reads the PBES2 parameters of an encrypted PKCS#8
827
+ key without the password (iterations, salt, PRF, AES-CBC variant, IV), and
828
+ `micro509/keys` exports `parsePbes2AlgorithmIdentifier` with the
829
+ `Pbes2Parameters` types behind it.
830
+ (https://github.com/kjanat/micro509/issues/66)
831
+ - `revocationReasonFromCode` maps a raw CRLReason integer to the
832
+ `RevocationReason` name the CRL path already returns, giving OCSP's
833
+ `revocationReasonCode` the same vocabulary.
834
+ (https://github.com/kjanat/micro509/issues/68)
835
+ - `micro509/result` exports `rethrowIfInvariant`, the boundary guard the
836
+ library's own catch blocks use to keep programmer errors from being
837
+ flattened into malformed-input failures.
838
+ (https://github.com/kjanat/micro509/issues/69)
839
+
840
+ ### Changed
841
+
842
+ - Tighten four exported TypeScript contracts to make invalid states
843
+ unrepresentable. These changes can require source updates:
844
+ - `CrlEncoderErrorCode` now contains only
845
+ `'distribution_point_full_name_empty'`.
846
+ `'distribution_point_name_conflict'` and
847
+ `'distribution_point_name_empty'` are removed because
848
+ `DistributionPointName` is now a discriminated union that cannot express
849
+ either invalid shape.
850
+ - `ParsedOcspSingleResponse` is now discriminated by `certStatus`.
851
+ `revokedAt` and `revocationReasonCode` are available only after narrowing to
852
+ `certStatus === 'revoked'`; `revokedAt` is then required.
853
+ - `CreateOcspCertStatusInput` rejects `revokedAt` and
854
+ `revocationReasonCode` unless `certStatus` is `'revoked'`, including when a
855
+ previously declared object is passed instead of an object literal.
856
+ - `CreateSelfSignedCertificateInput` no longer accepts both `keyPair` and
857
+ `algorithm`. Supply `keyPair` to reuse existing keys, or `algorithm` to
858
+ generate a new pair.
859
+
860
+ ```ts
861
+ if (singleResponse.certStatus === 'revoked') {
862
+ singleResponse.revokedAt; // Date
863
+ singleResponse.revocationReasonCode; // number | undefined
864
+ }
865
+
866
+ await createSelfSignedCertificate({ subject, keyPair });
867
+ await createSelfSignedCertificate({
868
+ subject,
869
+ algorithm: { kind: 'ecdsa', curve: 'P-256' },
870
+ });
871
+ ```
872
+
873
+ - `ParsedPkcs7SignedData.certificates: readonly ParsedCertificate[]` becomes
874
+ `certificateChoices: readonly ParsedCertificateChoice[]`, modelling [RFC 5652
875
+ §10.2.2][rfc5652-section-10.2.2] CertificateChoices as a discriminated union rather than discarding
876
+ four of its five alternatives. `certificate` carries the decoded X.509;
877
+ `extendedCertificate` (`[0]`, obsolete), `attributeCertificateV1` (`[1]`,
878
+ obsolete), `attributeCertificateV2` (`[2]`), and `other` (`[3]`, with its
879
+ `otherCertFormat` OID decoded) keep their DER including the context tag, so a
880
+ CertificateSet round-trips and a caller can tell an X.509-only bag from a
881
+ mixed one. A certificate set entry whose tag is none of these is rejected as
882
+ `malformed`; previously any non-SEQUENCE element was silently dropped.
883
+ `parsePkcs7CertBagDer` and `parsePkcs7CertBagPem` still return
884
+ `readonly ParsedCertificate[]`, now the X.509 projection of the set.
885
+ - Builder input-validation now throws a `ResultError` carrying a stable
886
+ machine-readable `code` rather than a bare `Error`. `createCertificate`, the
887
+ `encode*` extension helpers, distinguished-name encoding, and CRL/IDP encoding
888
+ reject invalid construction input (an empty `keyUsage`, a duplicate policy OID,
889
+ a `DisplayText` out of range, an invalid country code) with a coded throw that
890
+ `isResultError` detects and `error.code` discriminates. Codes are per-operation
891
+ unions (`ExtensionEncoderErrorCode`, `NameEncoderErrorCode`,
892
+ `CrlEncoderErrorCode`, `CreateCertificateErrorCode`). DER decode guards and
893
+ exhaustiveness invariants keep throwing a plain `Error`. The thrown message
894
+ gains a `code: ` prefix. <!-- markdownlint-disable-line MD038 -->
895
+ - `AuthorityInformationAccess.uri: string` becomes `location: GeneralName`, the
896
+ full accessLocation [RFC 5280 §4.2.2.1][rfc5280-section-4.2.2.1] defines. The parser threw
897
+ `Unsupported authorityInfoAccess location tag` for any location that was not a
898
+ URI, so a certificate carrying a directoryName or dNSName accessLocation (both
899
+ conformant) failed to parse entirely. An OCSP entry requires a URI location
900
+ (its discovery reads only URIs); `directoryName` is defined for `caIssuers`,
901
+ and other GeneralName forms are syntactically representable. GeneralName
902
+ encoding and parsing now reject any tag, class, or constructedness that is not
903
+ one of the nine [RFC 5280 §4.2.1.6][rfc5280-section-4.2.1.6] alternatives (`x400Address [3]`,
904
+ `ediPartyName [5]`, and `registeredID [8]` are preserved as unknown). The
905
+ IA5String alternatives (`dNSName`, `rfc822Name`,
906
+ `uniformResourceIdentifier`) reject non-ASCII input on encode and decode.
907
+ (https://github.com/kjanat/micro509/pull/78)
908
+
909
+ ### Fixed
910
+
911
+ - Signature verification accepts an absent parameters field on the
912
+ sha256WithRSAEncryption, sha384WithRSAEncryption, and sha512WithRSAEncryption
913
+ AlgorithmIdentifiers. [RFC 4055 §5][rfc4055-section-5] requires the parameters to be NULL and
914
+ requires implementations to accept them absent as well as present; every
915
+ surface that resolves a signature algorithm reported
916
+ `unsupported_signature_algorithm_parameters` for the absent encoding, so a
917
+ conformant certificate, CRL, OCSP response, CSR, or PKCS#7 signature that
918
+ omits the NULL could not be verified. Parameters that are neither absent nor
919
+ a DER NULL are still rejected, and signatures this library produces still
920
+ carry the NULL.
921
+ - `verifyCertificateChain` and `validateCandidatePath` no longer reject a
922
+ self-issued leaf that another key signed. [RFC 5280 §3.2][rfc5280-section-3.2] calls a self-issued
923
+ certificate self-signed only when the public key it binds verifies its
924
+ signature, but the guard behind `allowSelfSignedLeaf` fired on matching issuer
925
+ and subject DNs alone. The [RFC 8410 §10.2][rfc8410-section-10.2] example certificate is exactly that
926
+ case, a self-issued X25519 certificate signed by a separate Ed25519 key, and
927
+ failed with `self_signed_leaf_not_allowed` when anchored on the [§10.1][rfc8410-section-10.1] key. The
928
+ guard now verifies the leaf against its own public key first and only reports
929
+ `self_signed_leaf_not_allowed` when that verification succeeds.
930
+ - Legacy OpenSSL-style encrypted PEM (`Proc-Type: 4,ENCRYPTED`) parsing accepts
931
+ an encapsulated header with no space after the colon (`DEK-Info:AES-256-CBC,…`).
932
+ The parser keyed on `': '`, so a conformant no-space header ended the header
933
+ scan early and folded into the base64 body.
934
+ (https://github.com/kjanat/micro509/pull/89)
935
+ - Legacy encrypted PEM parsing unfolds folded encapsulated headers. [RFC 1421
936
+ §4.6][rfc1421-section-4.6] defines encapsulated header folding by reference to [RFC 822][rfc822], and its
937
+ Figure 2 folds a `Key-Info:` field across two lines. Every line was treated as
938
+ a complete header, so a folded field was misparsed and its continuation fell
939
+ into the base64 body. A line opening with an [RFC 822 §3.3][rfc822-section-3.3] `LWSP-char` (SPACE
940
+ or HTAB) now continues the preceding field; per [§3.1.1][rfc822-section-3.1.1] unfolding drops the
941
+ CRLF and keeps the whitespace, so the field-body and the `Proc-Type` and
942
+ `DEK-Info` field comparisons strip the SPACE and HTAB unfolding leaves behind.
943
+ Only those two characters are stripped: `String.prototype.trim` also removes
944
+ VT, FF, NBSP, and every Unicode `Zs`, none of which [RFC 822][rfc822] admits, so a
945
+ header such as `Proc-Type: 4,<NBSP>ENCRYPTED` is rejected rather than read as
946
+ `4,ENCRYPTED`. (https://github.com/kjanat/micro509/issues/92)
947
+ - Certificate and CSR builders reject [RFC 5280][rfc5280] MUST-NOT constructions with coded
948
+ throws. `pathLenConstraint` requires the keyUsage extension to assert
949
+ `keyCertSign`; absent, empty, or `keyCertSign`-less keyUsage is rejected
950
+ ([§4.2.1.9][rfc5280-section-4.2.1.9], `path_length_requires_key_cert_sign`). An empty subject DN requires
951
+ a critical subjectAltName carrying at least one non-empty GeneralName; an empty
952
+ typed value (`{ type: 'dns', value: '' }`), an empty `subjectAltNames` array,
953
+ and a critical `customExtensions` SAN whose value holds no usable GeneralName
954
+ are all rejected ([§4.2.1.6][rfc5280-section-4.2.1.6], `empty_subject_requires_subject_alt_name`), so
955
+ `subject: {}` can no longer sign a certificate with no identity. Encoding a
956
+ GeneralName with an empty `dNSName`, `rfc822Name`, URI, or SRV value is
957
+ rejected ([§4.2.1.6][rfc5280-section-4.2.1.6], `empty_general_name_value`). A `cRLIssuer`, when present,
958
+ may only contain `directoryName` entries, rejecting a non-DN entry or a
959
+ directoryName smuggled through an `unknown` general name; a
960
+ `nameRelativeToCRLIssuer` distribution point additionally permits only one
961
+ ([§4.2.1.13][rfc5280-section-4.2.1.13], `distribution_point_crl_issuer_not_directory_name`,
962
+ `distribution_point_relative_name_multiple_crl_issuers`). Known extensions
963
+ supplied through `customExtensions` participate in these cross-field checks.
964
+ A `customExtensions` entry carrying a known OID must decode as that extension,
965
+ rather than reaching the wire as opaque bytes the parser then rejects
966
+ (`malformed_known_extension_value`). Extension OIDs resolve by their encoded
967
+ value, so a non-canonical spelling such as `2.5.029.17` is the same extension
968
+ as `2.5.29.17` for registry lookup, certificate-versus-CSR context
969
+ restrictions, and duplicate detection; the diagnostic still quotes the OID as
970
+ submitted. A custom `cRLDistributionPoints` payload runs the same [§4.2.1.13][rfc5280-section-4.2.1.13]
971
+ cRLIssuer checks as the typed field, since decoding proves structure but not
972
+ the profile the builder promises. `validateOid` also rejects an OID that parses
973
+ as decimals but breaks the X.660 arc bounds (`3.1`, `1.40`) with `invalid_oid`
974
+ rather than an uncoded `Error`.
975
+ (https://github.com/kjanat/micro509/pull/88)
976
+ - CRL applicability follows the [RFC 5280 §6.3.3][rfc5280-section-6.3.3] relying-party algorithm in
977
+ three places it diverged. A certificate without a CRLDP extension accepts a
978
+ CRL whose issuing distribution point names the certificate issuer or one of
979
+ its issuerAltName entries, per the [§6.3.3][rfc5280-section-6.3.3] assumed-distribution-point rule;
980
+ such a CRL previously reported `non_applicable`. A distribution point that
981
+ omits `distributionPoint` matches the CRL IDP name against its `cRLIssuer`
982
+ names ([§6.3.3][rfc5280-section-6.3.3] (b)(2)(i)); an in-scope indirect CRL was previously rejected.
983
+ Reason coverage uses the [§6.3.3][rfc5280-section-6.3.3] (d) interim_reasons_mask, unioned across every
984
+ matching distribution point, instead of the CRL's `onlySomeReasons` alone, so
985
+ a distribution point scoped to a subset of reasons no longer grants full
986
+ coverage. Every consumer of a CRL `good` — `checkChainRevocation`,
987
+ `checkCertificateRevocation`, delegated OCSP-responder validation, and
988
+ recursive CRL-signer validation — now treats a reason-scoped `good` as
989
+ definitive only once the applicable CRLs together cover all eight reasons; a
990
+ revoked verdict from any CRL still wins immediately. GeneralName applicability
991
+ comparisons apply the [RFC 5280][rfc5280] name comparison rules: dNSName is
992
+ case-insensitive ([§7.2][rfc5280-section-7.2]), the rfc822Name host-part is case-insensitive ([§7.5][rfc5280-section-7.5]),
993
+ an `otherName` SRV-ID is case-insensitive in both halves ([RFC 4985 §2][rfc4985-section-2]), and a
994
+ uniformResourceIdentifier is prepared per [§7.4][rfc5280-section-7.4] — IDN labels to ASCII
995
+ Compatible Encoding, lowercased scheme and host, percent-encoding and path
996
+ segment normalization, and scheme-based normalization for `ftp`, `http`,
997
+ `https`, and `ldap`. Certificate and CRL parsing now share one canonical
998
+ GeneralName decoder, so an SRV-ID matches across issuerAltName and the IDP.
999
+ `verifyCertificateChain` recognises a critical
1000
+ issuerAltName rather than rejecting it. A delta-CRL `removeFromCRL` entry for
1001
+ an expired certificate now measures expiry against the delta's `thisUpdate`
1002
+ ([§5.2.4][rfc5280-section-5.2.4]), not the evaluation time.
1003
+ (https://github.com/kjanat/micro509/pull/87)
1004
+ - `importEncryptedPkcs1Pem` and `importEncryptedSec1Pem` report a wrong password
1005
+ as `invalid_password` rather than occasionally as `malformed`. Traditional PEM
1006
+ encrypts with unauthenticated AES-CBC, so a wrong key clears the PKCS#7 padding
1007
+ check roughly once in every 256 attempts and yields random plaintext; the
1008
+ decrypted bytes are now required to parse as an `RSAPrivateKey` or
1009
+ `ECPrivateKey`, which is the check the PBES2 path already applied.
1010
+ - `importPkcs8Der` accepts a `OneAsymmetricKey` ([RFC 5958 §2][rfc5958-section-2] / [RFC 8410 §7][rfc8410-section-7]) that
1011
+ carries both `attributes [0]` and `publicKey [1]`. The parser capped at four
1012
+ elements, so a five-element v2 key that OpenSSL and Node WebCrypto both accept
1013
+ returned `malformed`. The tail is now validated structurally rather than by
1014
+ ASN.1 class alone: `attributes [0]` must be a constructed `SET OF`, an optional
1015
+ `publicKey [1]` must be a primitive BIT STRING after it, the version is coupled
1016
+ to the public key's presence (`v2` iff present), and well-formed unknown
1017
+ extension additions are tolerated per the type's X.680 extensibility marker.
1018
+ - SEC1 `ECPrivateKey` parsing rejects a version other than 1, comparing content
1019
+ octets ([RFC 5915 §3][rfc5915-section-3], "version SHALL be ... one"). Only the tag was checked, so
1020
+ version 0 or 2 was deferred to the WebCrypto backend as a misleading error.
1021
+ - PBES2 decryption no longer rejects a PBKDF2 salt shorter than eight bytes. [RFC
1022
+ 8018 §4.1][rfc8018-section-4.1] makes the eight-octet minimum a "should" for salt _selection_ and
1023
+ says the salt need not be checked on receipt, so `openssl pkcs8 -saltlen 4`
1024
+ could not be decrypted. The encrypt path keeps the minimum.
1025
+ (https://github.com/kjanat/micro509/pull/85)
1026
+ - Distinguished-name encoding enforces the [RFC 5280 Appendix A.1][rfc5280-appendix-A.1] attribute
1027
+ constraints: no attribute value may be empty (`SIZE (1..ub-…)`), and
1028
+ `commonName`/`organization`/`organizationalUnit`/`title`/`serialNumber` cap at
1029
+ 64 characters, `locality`/`state` at 128, `emailAddress` at 255, and
1030
+ `surname`/`givenName` at 32768 (`ub-name`). Only the country exact-length-2
1031
+ rule was enforced before. `street` stays unbounded (no A.1 bound applies).
1032
+ Bounds count code points.
1033
+ - `createCertificate` rejects an empty issuer distinguished name, per [RFC 5280
1034
+ §4.1.2.4][rfc5280-section-4.1.2.4] ("The issuer field MUST contain a non-empty distinguished name"). An
1035
+ empty subject with a critical subjectAltName stays valid ([§4.1.2.6][rfc5280-section-4.1.2.6]).
1036
+ (https://github.com/kjanat/micro509/pull/84)
1037
+ - PKCS#12 `MacData` omits `iterations` when it equals its `DEFAULT 1`, and the
1038
+ parser accepts a two-element `MacData`, defaulting `iterations` to 1
1039
+ ([RFC 7292 §4][rfc7292-section-4], X.690 §11.5 under DER). A conformant PFX with iteration count 1 previously
1040
+ failed to parse.
1041
+ - PBES2 `PBKDF2-params` omits the `prf` when it is the `DEFAULT`
1042
+ `algid-hmacWithSHA1` ([RFC 8018 A.2][rfc8018-appendix-A.2], X.690 §11.5 under DER); `keyLength`, being OPTIONAL
1043
+ rather than DEFAULT, is still emitted. `exportEncryptedPkcs8Der(key, { prf: 'HMAC-SHA-1' })`
1044
+ produced a non-DER structure.
1045
+ (https://github.com/kjanat/micro509/pull/83)
1046
+ - PKCS#7/CMS `SignedData` emits SHA-2 digest `AlgorithmIdentifier`s with absent
1047
+ parameters, per [RFC 5754 §2][rfc5754-section-2] (a MUST). Both `digestAlgorithms` and each
1048
+ `SignerInfo.digestAlgorithm` carried an explicit `05 00` NULL.
1049
+ - `createPkcs7CertBag` orders the `certificates` `CertificateSet` canonically
1050
+ (DER SET OF, X.690 §11.6), matching `createPkcs7SignedData`. It concatenated
1051
+ certificates in caller order, so the output was not valid DER and depended on
1052
+ input order.
1053
+ (https://github.com/kjanat/micro509/pull/82)
1054
+ - PEM decoding handles every [RFC 7468 §3][rfc7468-section-3] newline convention (`CRLF`, `CR`, `LF`).
1055
+ `pemDecode` and `splitPemBlocks` stripped `\r` outright, which joins every line
1056
+ of a CR-only file into one, so such a file failed to decode.
1057
+ - `splitPemBlocks` accepts [RFC 7468][rfc7468] labels with an internal `-` separator and no
1058
+ longer discards unrelated blocks in the same file when it meets a label it does
1059
+ not recognise.
1060
+ - `pemEncode` emits the [RFC 7468][rfc7468] strict trailing end-of-line, so concatenating
1061
+ two blocks no longer produces `-----END … ----------BEGIN …-----`, which
1062
+ `openssl storeutl` rejects. (https://github.com/kjanat/micro509/pull/81)
1063
+ - `subjectAltName` parsing rejects an empty or non-SEQUENCE extension value, per
1064
+ [RFC 5280 §4.2.1.6][rfc5280-section-4.2.1.6] (`GeneralNames ::= SEQUENCE SIZE (1..MAX)`). An empty SAN
1065
+ previously decoded to `[]`, indistinguishable from an absent extension, so
1066
+ common-name fallback suppression did not engage. `directoryName [4]` now
1067
+ requires exactly one explicit X.501 Name with valid RDN and attribute
1068
+ structure instead of repairing malformed implicit encodings, including in
1069
+ CRL GeneralNames.
1070
+ - `extendedKeyUsage` parsing rejects an empty SEQUENCE and any child that is not
1071
+ an OBJECT IDENTIFIER, per [RFC 5280 §4.2.1.12][rfc5280-section-4.2.1.12]. `decodeObjectIdentifier` ran on
1072
+ every child regardless of tag, so `30 03 02 01 01` fabricated the OID `0.1`
1073
+ from an INTEGER. (https://github.com/kjanat/micro509/pull/80)
1074
+ - Extension encoders reject input [RFC 5280][rfc5280] forbids rather than emitting
1075
+ non-conformant DER: an empty `keyUsage` ([§4.2.1.3][rfc5280-section-4.2.1.3]), `extendedKeyUsage`
1076
+ ([§4.2.1.12][rfc5280-section-4.2.1.12]), `authorityInfoAccess`/`cRLDistributionPoints` ([§4.2.2.1][rfc5280-section-4.2.2.1],
1077
+ [§4.2.1.13][rfc5280-section-4.2.1.13]) or `nameConstraints` ([§4.2.1.10][rfc5280-section-4.2.1.10]) SEQUENCE, a duplicate certificate
1078
+ policy OID compared by encoded identity so leading-zero aliases collide
1079
+ ([§4.2.1.4][rfc5280-section-4.2.1.4]), a policy qualifier reusing the built-in `cps` or `userNotice` OID
1080
+ in the opaque `oid` variant ([§4.2.1.4][rfc5280-section-4.2.1.4]), a `DisplayText` outside SIZE (1..200)
1081
+ ([§4.2.1.4][rfc5280-section-4.2.1.4]), and an IP name constraint whose address and mask do not total 8 or
1082
+ 32 octets ([§4.2.1.10][rfc5280-section-4.2.1.10]). Each previously encoded a structure the library's own
1083
+ parser, or OpenSSL, rejects.
1084
+ (https://github.com/kjanat/micro509/pull/79)
1085
+ - A `directoryName` SubjectAltName or name constraint now encodes the complete
1086
+ Name TLV inside `[4]`, per [RFC 5280 §4.2.1.6][rfc5280-section-4.2.1.6] (Name is an untagged CHOICE, so
1087
+ `[4]` is EXPLICIT). The encoder stripped the Name's SEQUENCE header, emitting
1088
+ `a4 12 31 10 ...` where OpenSSL emits `a4 14 30 12 31 10 ...`.
1089
+ - An `otherName` SubjectAltName now decodes with the type-id and value as the
1090
+ direct children of `[0]`, per [RFC 5280 §4.2.1.6][rfc5280-section-4.2.1.6] (`otherName [0]` is IMPLICIT,
1091
+ so `[0]` replaces the SEQUENCE tag). The parser required an inner SEQUENCE, so
1092
+ any real `otherName` (an SRV-ID, a Microsoft UPN) failed the whole certificate
1093
+ parse; the SRV-ID encoder emitted the same non-conformant nesting. A
1094
+ structurally valid `otherName` with an unsupported type is preserved as
1095
+ `{ type: 'unknown' }`, but a malformed `otherName` envelope or a malformed
1096
+ value of a recognised `id-on-dnsSRV` is rejected rather than erased to
1097
+ `unknown`. Path validation rejects a critical `subjectAltName` carrying a
1098
+ GeneralName the verifier cannot interpret ([RFC 5280 §4.2][rfc5280-section-4.2]), while a
1099
+ non-critical one keeps the unknown entry.
1100
+ (https://github.com/kjanat/micro509/pull/77)
1101
+ - OCSP responses now encode `ResponderID` `byKey` as `[2]` EXPLICIT wrapping an
1102
+ OCTET STRING and every time field as GeneralizedTime, per [RFC 6960 Appendix
1103
+ B.1][rfc6960-appendix-B.1]. The `byKey` responder was written as `[2]` IMPLICIT over the raw hash and
1104
+ the times as UTCTime, so OpenSSL and Go's `crypto/ocsp` could not parse a
1105
+ response this library produced. The parser reads the EXPLICIT form and
1106
+ requires the `byKey` hash to be a 20-byte SHA-1 digest. Embedded certificates
1107
+ are wrapped in the `certs [0] EXPLICIT SEQUENCE OF Certificate` the field's
1108
+ syntax requires rather than concatenated, so a response with `includedCertificates`
1109
+ is parseable. An end-to-end differential test confirms OpenSSL accepts a
1110
+ micro509-produced response.
1111
+ (https://github.com/kjanat/micro509/pull/76)
1112
+ - The certificate builder enforces the [RFC 8410 §5][rfc8410-section-5] keyUsage rules for the four
1113
+ 1.3.101 curves. A keyUsage extension on a certificate whose subject key names
1114
+ id-X25519 or id-X448 must set `keyAgreement`
1115
+ (`montgomery_key_usage_requires_key_agreement`); one whose subject key names
1116
+ id-Ed25519 or id-Ed448 must set `nonRepudiation` or `digitalSignature`, widened
1117
+ in a certification authority certificate to also accept `keyCertSign` or
1118
+ `cRLSign` (`edwards_key_usage_requires_signing_bit`). The X25519 and X448
1119
+ clause admits "one of the following MAY also be present: encipherOnly; or
1120
+ decipherOnly", so a keyUsage setting both is rejected
1121
+ (`montgomery_key_usage_forbids_both_cipher_bits`); the two Ed clauses say "one
1122
+ or both" and "one or more", and keep combining. All three codes join
1123
+ `ExtensionEncoderErrorCode`. The rules bind only a keyUsage that reaches the
1124
+ wire, and read the effective value across the typed field and a
1125
+ `customExtensions` entry carrying the keyUsage OID. `OIDS` gains `x25519`,
1126
+ `x448`, and `ed448` alongside the existing `ed25519`.
1127
+ - PKCS#8 import requires the `privateKey` field of an id-X25519, id-X448,
1128
+ id-Ed25519, or id-Ed448 key to hold exactly one DER `CurvePrivateKey` OCTET
1129
+ STRING, per [RFC 8410 §7][rfc8410-section-7]. The field's content was passed to WebCrypto
1130
+ unexamined, so a BER long-form length (`04 81 20 …`) around an otherwise
1131
+ valid Ed25519 key imported.
1132
+ - `publicKeyAlgorithmName` reports `X25519`, `X448`, and `Ed448` alongside the
1133
+ existing `Ed25519`, and `signatureAlgorithmName` reports `Ed448`, the
1134
+ human-readable names [RFC 8410 §8][rfc8410-section-8] establishes. Every one of those OIDs was
1135
+ reported as `Unknown (1.3.101.…)`, including the subject key of the X25519
1136
+ certificate the RFC prints in [§10.2][rfc8410-section-10.2]. The names reach certificate, CSR, CRL,
1137
+ OCSP, and PKCS#7 parse output.
1138
+ - CSR parsing rejects a `CertificationRequestInfo` that omits `attributes [0]`,
1139
+ per [RFC 2986 §4.1][rfc2986-page-5], which lists it as a component without `OPTIONAL`. A
1140
+ three-field request parsed and came back with an empty `requestedExtensions`,
1141
+ so a truncated structure was indistinguishable from one requesting no
1142
+ extensions. [RFC 7468 §7][rfc7468-section-7] requires the octets under the `CERTIFICATE REQUEST`
1143
+ label to be a `CertificationRequest` as described in [RFC 2986][rfc2986].
1144
+ - PKCS#7/CMS PEM parsing accepts the [RFC 7468 §9][rfc7468-section-9] `CMS` label alongside `PKCS7`.
1145
+ `parsePkcs7SignedDataPem`, `parsePkcs7CertBagPem`, and `verifyPkcs7SignedData`
1146
+ read only `PKCS7` blocks, so the [RFC 5652][rfc5652] ContentInfo that [§9][rfc7468-section-9] armors was
1147
+ unreadable, including the RFC's own Figure 11.
1148
+ - `createPkcs7SignedData` armors a version 3 SignedData under the `CMS` label.
1149
+ Version 3 (an `encapContentInfo` `eContentType` other than `id-data`, [RFC 5652
1150
+ §5.1][rfc5652-section-5.1]) is outside [RFC 2315][rfc2315], whose SignedData version "shall be 1" ([§9.1][rfc2315-section-9.1]), and
1151
+ [RFC 7468 §8][rfc7468-section-8] requires the octets under `PKCS7` to be an [RFC 2315][rfc2315] ContentInfo. A
1152
+ version 1 SignedData and the degenerate certificate bag keep the `PKCS7` label.
1153
+ - The certificate builder rejects a keyUsage that gives one 1.3.101 subject key
1154
+ both applications [RFC 8410 §12][rfc8410-section-12] separates: "the same public key cannot be used
1155
+ for both ECDH and EdDSA". A certificate whose subject key names id-X25519 or
1156
+ id-X448 must not set `digitalSignature`, `nonRepudiation`, `keyCertSign`, or
1157
+ `cRLSign` (`montgomery_key_usage_forbids_signature_bit`); one whose subject key
1158
+ names id-Ed25519 or id-Ed448 must not set `keyAgreement`, `encipherOnly`, or
1159
+ `decipherOnly` (`edwards_key_usage_forbids_agreement_bit`). [RFC 5280 §4.2.1.3][rfc5280-section-4.2.1.3]
1160
+ defines the first four bits over a key used to verify signatures and
1161
+ `keyAgreement` over a key used for key agreement, and leaves `encipherOnly` and
1162
+ `decipherOnly` undefined without it. Both codes join
1163
+ `ExtensionEncoderErrorCode`.
1164
+ - The certificate builder rejects a `serialNumber` [RFC 5280 §4.1.2.2][rfc5280-section-4.1.2.2] forbids a CA
1165
+ to issue: a zero value ("the serial number MUST be a positive integer",
1166
+ `serial_number_not_positive`) and one whose DER INTEGER runs past 20 octets
1167
+ ("Conforming CAs MUST NOT use serialNumber values longer than 20 octets",
1168
+ `serial_number_too_long`, counting the leading zero octet a high bit forces).
1169
+ The bytes were encoded unexamined, so `new Uint8Array(21)` or an empty array
1170
+ produced a certificate no conforming CA may issue. Both codes join
1171
+ `CreateCertificateErrorCode`.
1172
+ - The CRL builder rejects an empty issuer distinguished name
1173
+ (`issuer_distinguished_name_empty`, joining `CrlEncoderErrorCode`). [RFC 5280
1174
+ §5.1.2.3][rfc5280-section-5.1.2.3] requires the issuer field to contain a non-empty X.500 distinguished
1175
+ name, and [RFC 7468 §6][rfc7468-section-6] requires the octets under the `X509 CRL` label to be a
1176
+ `CertificateList` as described in [RFC 5280 §5][rfc5280-section-5]. `createCertificateRevocationList`
1177
+ encoded an empty `SEQUENCE` for `issuer: {}`, naming an entity no certificate
1178
+ can identify. The certificate builder already enforced the same rule from
1179
+ [RFC 5280 §4.1.2.4][rfc5280-section-4.1.2.4].
1180
+ - Parsing checks the ASN.1 tag of an `AlgorithmIdentifier`, of a `Name` and its
1181
+ `RelativeDistinguishedName` and `AttributeTypeAndValue` components, and of a
1182
+ PKCS#10 attribute and its `type` and `values` fields. [RFC 7468 §7][rfc7468-section-7] requires the
1183
+ octets under the `CERTIFICATE REQUEST` label to be a `CertificationRequest` as
1184
+ described in [RFC 2986][rfc2986], whose [§4.1][rfc2986-page-5] and [§4.2][rfc2986-page-7] give each of those fields a type.
1185
+ A CSR could carry its subject as a `SET`, its signature algorithm as a `SET`,
1186
+ or an attribute whose `type` was an OCTET STRING holding the extensionRequest
1187
+ OID's content octets, and parse; the last one had its extensions decoded as if
1188
+ the type had been an OBJECT IDENTIFIER. An attribute `values` field is now also
1189
+ required to be a non-empty `SET`, per the `SET SIZE(1..MAX)` in [RFC 2986 §4.1][rfc2986-page-5].
1190
+ The `AlgorithmIdentifier` and `Name` checks apply to certificate, CRL, and OCSP
1191
+ parsing as well.
1192
+ - PKCS#7/CMS parsing rejects a SignedData whose `EXPLICIT [0]` content tag holds
1193
+ more than one value, and one whose signed `contentInfo` is not the two-field
1194
+ `SEQUENCE` of [RFC 2315 §7][rfc2315-section-7] with an OBJECT IDENTIFIER `contentType`. [RFC 7468 §8][rfc7468-section-8]
1195
+ requires the octets under `PKCS7` to be an [RFC 2315][rfc2315] ContentInfo, whose `content`
1196
+ is `[0] EXPLICIT ANY DEFINED BY contentType OPTIONAL`. A value appended inside
1197
+ the `eContent` tag was ignored and `verifyPkcs7SignedData` still returned `ok`,
1198
+ because [RFC 2315 §9.3][rfc2315-section-9.3] digests only the contents octets of the first value, so
1199
+ two encodings verified under one signature; a `contentType` carrying another
1200
+ tag was decoded as if it were an OBJECT IDENTIFIER, yielding a fabricated OID.
1201
+ - `createPkcs7SignedData` and `createOcspResponse` reject a signer certificate
1202
+ whose subject public key cannot verify the algorithm the signer private key
1203
+ produces. [RFC 8410 §12][rfc8410-section-12]: "the same public key cannot be used for both ECDH and
1204
+ EdDSA", and both builders accepted an id-X25519 certificate beside an Ed25519
1205
+ key, emitting a SignerInfo or a BasicOCSPResponse that named id-Ed25519 over a
1206
+ certificate that can never verify it. `CreatePkcs7SignedDataErrorCode` gains
1207
+ `signer_certificate_key_mismatch`; `createOcspResponse` throws a `ResultError`
1208
+ carrying the same code, from the new `OcspEncoderErrorCode`.
1209
+ - Base64 decoding rejects a final quantum that is not the [RFC 4648 §4][rfc4648-section-4] encoding
1210
+ of its own octets. [RFC 7468 §2][rfc7468-section-2] takes the encapsulated data as base64 "according
1211
+ to Section 4 of [RFC4648]", which completes a short final quantum with pad
1212
+ characters and "bits with value zero", and [§14][rfc7468-section-14] names data encoding ambiguity as
1213
+ an opportunity for side channels. `atob` ignores the pad bits and the padding
1214
+ alike, so four texts decoded to a one-pad structure and sixteen to a two-pad
1215
+ one: Figure 6 of [RFC 7468][rfc7468] parsed to the same certificate from a body ending
1216
+ `Ipo=`, `Ipp=`, `Ipq=`, or `Ipr=`,
1217
+ and an unpadded `AQ` decoded as `AQ==` does. `pemDecode`, `splitPemBlocks`,
1218
+ every PEM parser above them, `importSpkiBase64`, `importPkcs8Base64`, and
1219
+ legacy encrypted PEM now reject both.
1220
+
1221
+ ### Security
1222
+
1223
+ - `verifyCertificateChain` reported `ok: true` for a chain containing a
1224
+ certificate whose `id-ecPublicKey` public key carries no namedCurve OID,
1225
+ which [RFC 5480 §2.1.1][rfc5480-section-2.1.1] requires clients to reject. The caller received a
1226
+ "verified" certificate binding a key `certificatePublicKey` cannot import.
1227
+ Chain validation now fails such a path with `ec_domain_parameters_missing`
1228
+ (joining `VERIFY_ERROR_CODES`); absent parameters, an `implicitCurve` NULL,
1229
+ and a `specifiedCurve` SEQUENCE all fail it.
1230
+ - Parsing rejects a zero-length `dNSName`, `rfc822Name`, or
1231
+ `uniformResourceIdentifier` GeneralName, which [RFC 5280 §4.2.1.6][rfc5280-section-4.2.1.6] forbids. An
1232
+ external certificate could previously carry an empty subjectAltName value and
1233
+ parse, leaving chain verification to accept a certificate with no usable
1234
+ identity when no identity match was requested. Certificate and CRL parsing
1235
+ share the decoder, so this covers subjectAltName, issuerAltName,
1236
+ authorityInfoAccess locations, CRL distribution points, `cRLIssuer`, the
1237
+ issuing distribution point, and `certificateIssuer`. Name constraints keep
1238
+ their own decoder, where an empty base is meaningful.
1239
+ (https://github.com/kjanat/micro509/pull/88)
1240
+ - CRL parsing rejects a `CertificateList` whose `signatureAlgorithm` differs
1241
+ from the `signature` field of the signed `tbsCertList`, per [RFC 5280 §5.1.1.2][rfc5280-section-5.1.1.2].
1242
+ The outer field is outside the signature, and it was the one reported as the
1243
+ CRL's signature algorithm, so a CRL could name one algorithm to the caller and
1244
+ another to the signer. Certificate parsing already enforced the same rule from
1245
+ [RFC 5280 §4.1.1.2][rfc5280-section-4.1.1.2].
1246
+
1247
+ ## [0.13.0] - 2026-07-23
1248
+
1249
+ A public `micro509/der` entrypoint, and RFC-conformance fixes across path
1250
+ validation: name constraints, issuer chaining, CRL issuer paths,
1251
+ distinguished-name comparison, and policy node sets.
1252
+
1253
+ ### Added
1254
+
1255
+ - `micro509/der` exposes the DER reader, writer, and value decoders that back
1256
+ every built-in parser. `defineExtensionDecoder` hands a consumer `valueDer` and
1257
+ expects raw DER back from `encode`, and nothing in the public API could read or
1258
+ write those bytes, so a custom extension needed a second ASN.1 library.
1259
+ Readers and decoders take untrusted bytes and come in pairs: `decodeDerInteger`
1260
+ returns a `Result`, `decodeDerIntegerOrThrow` throws. Writers take typed input
1261
+ and throw, matching `encodeName` and `pemEncode`.
1262
+ (https://github.com/kjanat/micro509/issues/63)
1263
+ - `bmpString` and `universalString` encode the two string types that already
1264
+ decoded, so a PKCS#12 `friendlyName` can now be written as well as read. Both
1265
+ reject lone surrogates, and `bmpString` rejects code points above U+FFFF.
1266
+ - `decodeBitString` returns a BIT STRING's payload with its unused-bit count.
1267
+ `extractBitStringValue` rejects a non-zero count, which excluded KeyUsage, the
1268
+ most common BIT STRING in a certificate. Unused trailing bits are returned as
1269
+ encoded, matching how the extension decoders already treat non-conformant
1270
+ certificates.
1271
+
1272
+ ### Changed
1273
+
1274
+ - `decodeIntegerNumber` accepts a non-negative, minimally encoded INTEGER up to
1275
+ `Number.MAX_SAFE_INTEGER` and rejects above it. Negative and non-minimal
1276
+ encodings are still rejected, as before. It stopped at 6 bytes while
1277
+ `integerFromNumber` encoded any non-negative safe integer, so values from 2^47
1278
+ up encoded and would not decode.
1279
+ The old limit cited 48 bits as the safe-integer boundary; that boundary is 53.
1280
+ A 7- or 8-byte INTEGER inside a certificate that previously threw now parses.
1281
+
1282
+ ### Security
1283
+
1284
+ - Name constraints reject a URI SAN whose authority has no FQDN host (an IP
1285
+ literal, a single-label host such as `localhost`, or no authority at all)
1286
+ when a uniformResourceIdentifier constraint applies, per [RFC 5280 §4.2.1.10][rfc5280-section-4.2.1.10].
1287
+ Such a URI previously slipped past the
1288
+ constraint. Email constraint matching now compares the local part
1289
+ case-sensitively and only the host case-insensitively ([RFC 5280 §7.5][rfc5280-section-7.5], as
1290
+ replaced by [RFC 9549 §7.5.1][rfc9549]), so `admin@example.com` no longer matches
1291
+ `ADMIN@example.com` and widens the permitted subtrees.
1292
+ (https://github.com/kjanat/micro509/pull/71)
1293
+ - `validateCandidatePath` compares each certificate's issuer DN against the
1294
+ candidate issuer's subject DN, per [RFC 5280 §6.1.3][rfc5280-section-6.1.3](a)(4). It verified only the
1295
+ signature, so a leaf whose issuer DN was unrelated to the signing CA validated
1296
+ as ok on the pre-built-path API. `buildChainInternal` already compared them,
1297
+ so `verifyCertificateChain` was unaffected.
1298
+ (https://github.com/kjanat/micro509/pull/72)
1299
+ - CRL evidence validates the CRL issuer's own certification path to the trust
1300
+ anchor before trusting its verdict ([RFC 5280 §6.3.3][rfc5280-section-6.3.3](f)). A forged
1301
+ indirect-CRL signer whose subject DN collided with a chain certificate was
1302
+ accepted on a name match, its signature never checked against a trusted key,
1303
+ so a forged empty CRL reported a revoked certificate as `good`. Each
1304
+ candidate CRL issuer runs the full pipeline as one step (signature, then
1305
+ [§6.3.3][rfc5280-section-6.3.3](f) path, then signer revocation), so an unusable candidate no longer
1306
+ shadows a later authorized one, and the signer's path is validated against a
1307
+ pool that includes the validated chain intermediates, so a delegated signer
1308
+ issued by a chain CA authorizes. Without these, a genuine revoked CRL became
1309
+ `crl_signer_not_authorized` and soft-fail allowed the revoked certificate.
1310
+ (https://github.com/kjanat/micro509/pull/73)
1311
+ - Distinguished name comparison implements the [RFC 4518][rfc4518] string-preparation
1312
+ profile that [RFC 5280 §7.1][rfc5280-section-7.1] requires, against the frozen Unicode 3.2 repertoire
1313
+ [RFC 4518 §2.1][rfc4518-section-2.1] fixes: the Map, Normalize, Prohibit, and Insignificant Space
1314
+ steps with the complete [RFC 3454 Appendix B.2][rfc3454-appendix-B.2] case fold and Table A.1
1315
+ unassigned set. The old NFKC-plus-lowercase shortcut left ignorable code
1316
+ points in place (so an excluded subtree failed to exclude a name carrying a
1317
+ SOFT HYPHEN), folded with `toLowerCase` alone (so `Straße` did not equal
1318
+ `STRASSE`), and delegated the repertoire to the running Unicode version. That
1319
+ last part let a code point unassigned in 3.2 slip through: U+1D2C normalized
1320
+ to `a` and matched `CN=a`, U+2F868 used the Unicode 4.0 NFKC correction, and
1321
+ U+10A0 took a post-3.2 fold. The A.1 unassigned set, the B.2 fold, and the
1322
+ five CJK NFKC corrections are generated from the vendored [RFC 3454][rfc3454] and guarded
1323
+ by a test that re-derives them from the RFC text. BMPString and UniversalString
1324
+ values are prepared alongside UTF8String and PrintableString. `domainComponent`
1325
+ compares as `caseIgnoreIA5Match` ([RFC 4519][rfc4519]), requiring the IA5String tag and
1326
+ ASCII, so a UTF8String or non-ASCII value no longer matches an IA5String one;
1327
+ `DC=Example` chains to `DC=example`. Bare-anchor selection confirms the
1328
+ anchor's subject equals the certificate's issuer rather than trusting the
1329
+ canonical-key bucket. [RFC 4518][rfc4518] and [RFC 3454][rfc3454] are vendored under `docs/rfc/`.
1330
+ (https://github.com/kjanat/micro509/pull/74)
1331
+ - Certificate policy validation computes the [RFC 9618 §5.5][rfc9618-section-5.5](g)
1332
+ `valid_policy_node_set` correctly: the nodes at any depth whose valid_policy
1333
+ is not anyPolicy and whose single parent is an anyPolicy node, plus a depth-n
1334
+ anyPolicy node. It previously took depth-n nodes tracing back to the depth-0
1335
+ anyPolicy root, which diverges under policy mapping. A CA that mapped
1336
+ `1.2.3.4` to `1.2.3.5` reported `authorityConstrainedPolicies` of `1.2.3.5`
1337
+ where the spec requires `1.2.3.4` (NIST PKITS 4.10.1), so a chain validated
1338
+ against the mapped policy instead of the authority's. `userConstrainedPolicies`
1339
+ now follows [§5.5][rfc9618-section-5.5](g)(5)-(6) from the corrected set. Policy validation also
1340
+ processes the terminal certificate when a bare trust anchor is used: a path
1341
+ built to an out-of-band anchor ends at a real CA, and skipping it let a leaf
1342
+ policy satisfy `initialPolicySet` even when that CA omitted or contradicted
1343
+ the policy. `authorityConstrainedPolicies` now aggregates each policy's
1344
+ qualifiers from its node, ancestors, and descendants per [§5.5][rfc9618-section-5.5](g)(4)(ii)
1345
+ rather than reporting one arbitrary node's set.
1346
+ (https://github.com/kjanat/micro509/pull/75)
1347
+
1348
+ ## [0.12.0] - 2026-07-21
1349
+
1350
+ Text rendering for subject alternative names and distinguished names, and
1351
+ runnable docs examples that survive client-side navigation.
1352
+
1353
+ ### Added
1354
+
1355
+ - `subjectAltNameToString(name, options?)` renders one `SubjectAltName` as text.
1356
+ Printing a SAN is the most ordinary thing to do with one after parsing, and it
1357
+ took a hand-written narrowing in every consumer: `dns`/`ip`/`email`/`uri`/`srv`
1358
+ carry a `string` value, `directoryName` carries only `derHex` and has no `value`
1359
+ at all, and `unknown` carries a `Uint8Array` that stringifies itself as
1360
+ `192,0,2,1` inside a `join()`. A `directoryName` now renders as an [RFC 4514][rfc4514]
1361
+ distinguished name (`CN=Example CA,O=Acme\, Inc.,C=US`), falling back to its hex
1362
+ when the DER does not decode, and an `unknown` renders as hex. Pass
1363
+ `{ prefix: true }` for the `openssl x509 -text` labels (`DNS:`, `IP Address:`,
1364
+ `DirName:`), or call `subjectAltNameLabel(name)` for the label alone. Companion
1365
+ `distinguishedNameToString(name)` and `relativeDistinguishedNameToString(rdn)`
1366
+ render a parsed subject or issuer, which until now had no public renderer either.
1367
+ Exported from the root and `micro509/x509`, with the `SubjectAltNameTextOptions`
1368
+ type. (https://github.com/kjanat/micro509/issues/50)
1369
+
1370
+ - The docs site serves a permalink for the newest release. `/v0.11.0/…` used to
1371
+ 404 while 0.11.0 sat at the root, then silently come into existence as an
1372
+ archive one release later, so a link to the root changed meaning on every
1373
+ release. The build now emits a `_redirects` file sending `/v<latest>/*` to the
1374
+ root with a 302; once the next release takes the root, the rule disappears and
1375
+ the same URL serves the archived copy. Temporary on purpose: browsers cache a
1376
+ 301 past the release that makes it wrong.
1377
+
1378
+ ### Changed
1379
+
1380
+ - The X.509 reference now identifies every asynchronous operation in one place
1381
+ and explains the split: PEM/DER parsing and transformation are synchronous,
1382
+ while hashing, signing, and key operations backed by WebCrypto return promises.
1383
+ The API summaries for `parseCertificatePem` and `certificateFingerprint` make
1384
+ their return timing explicit, avoiding a no-op `await` on the parser or reading
1385
+ properties from an unawaited fingerprint promise.
1386
+ (https://github.com/kjanat/micro509/issues/51)
1387
+ - The docs site no longer co-hosts the library: each version's runnable examples
1388
+ import it from a CDN, bound to the version that page documents. A release imports
1389
+ what it published, from jsDelivr, whose `+esm` builds arrive bundled — one request
1390
+ where esm.sh's module graph took thirty-nine, and a third of the time to load.
1391
+ `/next/` imports a pkg.pr.new build of the deployed commit, which only esm.sh can
1392
+ serve, bundled with `?standalone`. The co-hosted copy put the library's own file
1393
+ layout in the site's URL space, where `x509/fingerprint.js` matched an EasyPrivacy
1394
+ rule blocking that path on every domain (`/fingerprint.js^$domain=~github.com`).
1395
+ Content blockers refused it, and because it is a static import of the root entry,
1396
+ every example on the site died for readers running one.
1397
+ - CI gates the docs site on its examples actually working: `run site:import-maps`
1398
+ checks every version's map names its own library and that every URL in it resolves,
1399
+ and `run site:live-examples` clicks Run in a real browser with a content blocker
1400
+ simulated — a headless browser has none, and would have passed while the bug above
1401
+ was live.
1402
+ - Materializing an archived version's pages now repairs a runnable example the tag
1403
+ shipped with a syntax error, so its Run button executes valid code. Each `<LiveCode>`
1404
+ block is parsed, and one missing the brace that closes a block gets it restored at
1405
+ the position the TypeScript parser expects. Nine `guide/getting-started` examples
1406
+ across v0.3.0 through v0.9.0 were affected. The archived page then differs from the
1407
+ code that release published. (https://github.com/kjanat/micro509/issues/53)
1408
+
1409
+ ### Fixed
1410
+
1411
+ - Runnable examples now execute the version of the page they run on after
1412
+ client-side navigation. Each page shipped its own `<script type="importmap">`,
1413
+ which the browser reads once per document, so navigating from the landing page
1414
+ to an archived version and pressing Run resolved `micro509` against the entry
1415
+ page's map and imported the wrong release; only a hard refresh picked up the
1416
+ right one. Every page now ships one identical map: top-level imports for the
1417
+ root version and a scope per version prefix. Scopes match the URL of the
1418
+ importing module, and the injected example module inherits the document URL,
1419
+ so resolution follows the page at run time with no map swapping. `run
1420
+ site:import-maps` now verifies the map is identical on every page and each
1421
+ scope binds its own version, and `run site:live-examples` replays the failing
1422
+ flow: enter at the root, navigate client-side to an archive, run its example,
1423
+ and require every import to carry that archive's version.
1424
+
1425
+ ## [0.11.0] - 2026-07-13
1426
+
1427
+ Certificate fingerprinting and private-key ownership checks for certificate
1428
+ inspection, intake, and issuance workflows.
1429
+
1430
+ ### Added
1431
+
1432
+ - `certificateFingerprint(certificate, algorithm?)` computes the standard
1433
+ certificate fingerprint — a hash over the DER encoding, the identifier
1434
+ `openssl x509 -fingerprint` and TLS UIs display. It accepts the same
1435
+ `string | Uint8Array | ParsedCertificate` source union as the verification
1436
+ APIs and returns `{ bytes, hex, colonHex }`: the raw digest, lowercase hex
1437
+ with no separators, and uppercase colon-separated hex (openssl style). It
1438
+ defaults to SHA-256; SHA-1/384/512 are also supported for legacy interop
1439
+ (older certificate pinning, PGP-adjacent tooling). Exported from the root and
1440
+ `micro509/x509` as `certificateFingerprint`, with `CertificateFingerprint`,
1441
+ `CertificateFingerprintAlgorithm`, and `CertificateFingerprintSource` types.
1442
+ Interop with `openssl x509 -fingerprint` verified across all four algorithms.
1443
+ (https://github.com/kjanat/micro509/issues/45)
1444
+ - `certificateMatchesPrivateKey(certificate, privateKey)` checks whether an
1445
+ uploaded private key belongs to a certificate — the first thing any
1446
+ key-intake or issuance endpoint must do. It derives the public half of the
1447
+ private key, exports it as SubjectPublicKeyInfo DER, and byte-compares it
1448
+ against the certificate's own SPKI (the canonical, algorithm-agnostic
1449
+ ownership test), returning a plain `boolean`. `certificate` accepts a PEM
1450
+ string, DER bytes, or an already-parsed `ParsedCertificate`; a private key of
1451
+ a different type simply produces different SPKI and returns `false`.
1452
+ `matchCertificatePrivateKey` is the `Result`-returning companion: `ok: true`
1453
+ on a match, or a typed failure carrying `key_mismatch`, `key_type_mismatch`,
1454
+ `malformed_certificate`, or `unsupported_private_key` — so trust boundaries
1455
+ get the reason (and no thrown errors on untrusted input). The error-code
1456
+ union is exported as `MatchCertificatePrivateKeyErrorCode`.
1457
+ (https://github.com/kjanat/micro509/issues/46)
1458
+
1459
+ ## [0.10.0] - 2026-07-13
1460
+
1461
+ Detached PKCS#7 / CMS signatures — the form git x509 commit signing and S/MIME
1462
+ rely on — and algorithm inference across every private-key import family.
1463
+
1464
+ ### Added
1465
+
1466
+ - `createPkcs7SignedData` accepts `detached: true` to omit `eContent` from
1467
+ `encapContentInfo` ([RFC 5652 §5.2][rfc5652-section-5.2] detached form), and
1468
+ `verifyPkcs7SignedData` accepts an options bag with `content` to supply the
1469
+ externally-held bytes when verifying a detached signature — the shape git
1470
+ x509 commit signing (`gpg.format=x509`) and S/MIME detached signatures use.
1471
+ The error-code union is now exported as `VerifyPkcs7SignedDataErrorCode`, the
1472
+ options as `VerifyPkcs7SignedDataOptions`. Interop with `openssl cms`
1473
+ verified in both directions.
1474
+ (https://github.com/kjanat/micro509/issues/40)
1475
+ - The private-key import families infer the algorithm from the container when
1476
+ the `algorithm` parameter is omitted, mirroring the existing SPKI behavior;
1477
+ passing it still asserts and fails typed on mismatch:
1478
+ - `importPkcs8Der/Pem/Base64(+OrThrow)` and
1479
+ `importEncryptedPkcs8Der/Pem(+OrThrow)` read the PKCS#8
1480
+ `privateKeyAlgorithm` (RSA defaults to `pkcs1-v1_5`/`SHA-256`, as with
1481
+ SPKI inference).
1482
+ - `importSec1Der/Pem(+OrThrow)` and `importEncryptedSec1Pem(+OrThrow)` read
1483
+ the [RFC 5915][rfc5915] `parameters [0]` named curve; a SEC 1 key without one still
1484
+ requires the explicit curve.
1485
+ - `importPublicJwk`/`importPrivateJwk`(+`OrThrow`) read `kty`, `crv`, and
1486
+ `alg` (`RS*`/`PS*`/`RSA-OAEP-256/384/512` select the RSA scheme and hash).
1487
+ (https://github.com/kjanat/micro509/issues/41)
1488
+
1489
+ ### Changed
1490
+
1491
+ - **BREAKING** — `verifyPkcs7SignedData` reports a SignedData that carries no
1492
+ `eContent` as `'detached_content_required'`; the `'content_missing'` code is
1493
+ gone. Such a message is not malformed, it is a detached signature awaiting
1494
+ its external content, and it is now only a failure when no `content` option
1495
+ is supplied. Rename any match on `'content_missing'`; matches against the
1496
+ exported `VerifyPkcs7SignedDataErrorCode` union fail to typecheck until you
1497
+ do.
1498
+ - `exportSec1Der`/`exportSec1Pem`/`exportEncryptedSec1Pem` always embed the
1499
+ [RFC 5915][rfc5915] `parameters [0]` named curve (WebCrypto's inner ECPrivateKey omits
1500
+ it; OpenSSL writes it), so exported SEC 1 keys are self-describing and
1501
+ re-import without an explicit curve.
1502
+ - Preserve public API behavior while decomposing DER, parsing, verification,
1503
+ revocation, PKCS#7, and API-documentation flows into focused helpers that
1504
+ satisfy the stricter cognitive-complexity limit. (https://github.com/kjanat/micro509/pull/39)
1505
+
1506
+ ### Fixed
1507
+
1508
+ - `createPkcs7SignedData` returns the typed `'invalid_signer_certificate'` /
1509
+ `'invalid_certificate'` (new code) failures for malformed signer and
1510
+ additional-certificate inputs instead of rejecting the promise. Each
1511
+ `additionalCertificates` value is structurally validated as a real X.509
1512
+ certificate, so malformed DER also returns `'invalid_certificate'`.
1513
+
1514
+ ## [0.9.0] - 2026-07-06
1515
+
1516
+ RSA-OAEP encryption support across the whole key lifecycle: generate, import,
1517
+ derive, encrypt, decrypt.
1518
+
1519
+ ### Added
1520
+
1521
+ - `RsaScheme` accepts `'oaep'`: `generateKeyPair`, the SPKI / PKCS#8 / JWK
1522
+ import functions, and `derivePublicKey` produce `RSA-OAEP` keys with
1523
+ `encrypt`/`decrypt` usages when the scheme is `'oaep'` (signature schemes
1524
+ keep `sign`/`verify`).
1525
+ (https://github.com/kjanat/micro509/pull/36)
1526
+ - `encryptRsaOaep` / `decryptRsaOaep` (and their `…OrThrow` siblings) encrypt
1527
+ and decrypt small messages with an RSA-OAEP key pair, with an optional OAEP
1528
+ `label` bound to the ciphertext. Failures are typed:
1529
+ `'invalid_key' | 'message_too_long'` on encrypt,
1530
+ `'invalid_key' | 'decryption_failed'` on decrypt — ciphertext-level
1531
+ decryption failures are deliberately opaque (no padding-oracle detail).
1532
+ - `RsaSignatureScheme` narrows `RsaScheme` to the signature schemes
1533
+ (`'pkcs1-v1_5' | 'pss'`), so certificate signature verification can never
1534
+ silently accept an OAEP key.
1535
+
1536
+ ## [0.8.0] - 2026-07-05
1537
+
1538
+ Key/certificate import ergonomics and validation hardening — every API
1539
+ finding from the OpenSSL differential fuzzer, shipped in one release.
1540
+
1541
+ ### Added
1542
+
1543
+ - The `keys` and `x509` domain barrels (and the root barrel) re-export the 20
1544
+ `OrThrow` siblings that were implemented and documented but unreachable from
1545
+ the published package — 16 key-import variants (`importSpkiDerOrThrow`,
1546
+ `importPkcs8PemOrThrow`, …) and 4 certificate/CSR parsers
1547
+ (`parseCertificateDerOrThrow`, …). A conventions test now fails whenever a
1548
+ barrel exposes a function while omitting its `OrThrow` sibling.
1549
+ (https://github.com/kjanat/micro509/issues/26)
1550
+ - `derivePublicKey(privateKey)` derives the matching public `CryptoKey` from
1551
+ an imported (or generated) private key, so a private key loaded via
1552
+ `importPkcs8*`/`importPkcs1*`/`importSec1*`/`importPrivateJwk` can go
1553
+ straight to `exportSpkiDer`/`exportSpkiPem` without hand-rolling JWK
1554
+ surgery. Supports RSA, ECDSA, and Ed25519.
1555
+ (https://github.com/kjanat/micro509/issues/19)
1556
+ - `importSpkiDer`, `importSpkiPem`, `importSpkiBase64` (and their `…OrThrow`
1557
+ variants) now accept an optional algorithm argument. A SubjectPublicKeyInfo
1558
+ already encodes its algorithm OID — and the EC curve OID — so when no hint is
1559
+ given the algorithm is inferred straight from the DER, letting callers import
1560
+ keys whose type isn't known ahead of time. Passing an explicit algorithm is
1561
+ unchanged and still asserts the key matches it.
1562
+ (https://github.com/kjanat/micro509/issues/20)
1563
+ - `getSubjectPublicKey(parsed)` / `getSubjectPublicKeyOrThrow(parsed)` import
1564
+ the subject public key of a parsed certificate or CSR as a WebCrypto
1565
+ `CryptoKey`, inferring the algorithm (and EC curve) from the embedded
1566
+ SubjectPublicKeyInfo — callers no longer hand-roll the
1567
+ `publicKeyAlgorithmOid` → import-algorithm mapping.
1568
+ (https://github.com/kjanat/micro509/issues/21)
1569
+
1570
+ ### Fixed
1571
+
1572
+ - `importPrivateJwk` / `importPrivateJwkOrThrow` now validate the JWK against
1573
+ the requested algorithm before handing it to WebCrypto, matching what
1574
+ `importPublicJwk` already did: `kty`/`crv` must match the requested
1575
+ `kind`/`curve`, the private material the kind implies must be present
1576
+ (`d` everywhere, plus `n`/`e`/`p`/`q`/`dp`/`dq`/`qi` for RSA), and
1577
+ symmetric (`k`) or multi-prime (`oth`) material is rejected.
1578
+ Wrong-algorithm and public-only JWKs previously surfaced as opaque
1579
+ WebCrypto errors instead of the library's `'malformed'` failures.
1580
+ (https://github.com/kjanat/micro509/issues/23)
1581
+ - `importSec1Der` / `importSec1Pem` / `importEncryptedSec1Pem` (and their
1582
+ `…OrThrow` variants) trusted the caller's `curve` without reading the SEC 1
1583
+ ECPrivateKey itself. The [RFC 5915][rfc5915] `parameters [0]` field (OpenSSL always
1584
+ writes it) is now parsed and cross-checked: a curve mismatch fails with
1585
+ `SEC 1 private key curve does not match requested import algorithm`, and
1586
+ bytes that are not an ECPrivateKey fail with `Malformed SEC 1 private key` —
1587
+ instead of both surfacing as WebCrypto's opaque "Malformed PKCS#8" error.
1588
+ Keys without the optional parameters field import as before.
1589
+ (https://github.com/kjanat/micro509/issues/22)
1590
+
1591
+ ## [0.7.2] - 2026-07-04
1592
+
1593
+ Error-classification fix for encrypted-key imports with a wrong password.
1594
+
1595
+ ### Fixed
1596
+
1597
+ - `importEncryptedPkcs8Der` / `importEncryptedPkcs8Pem` reported
1598
+ `'malformed'` instead of `'invalid_password'` roughly once per 256
1599
+ wrong-password attempts: AES-CBC padding is unauthenticated, so a wrong
1600
+ key occasionally "decrypts" to random bytes that pass the padding check,
1601
+ and the resulting PKCS#8 parse failure was misclassified. Decrypted
1602
+ plaintext that is not a PrivateKeyInfo now reports `'invalid_password'`.
1603
+ - `parsePfx` had the same wrong-password tail (reporting `'malformed'`),
1604
+ plus the reverse: structurally malformed EncryptedData could report
1605
+ `'invalid_password'`. Classification now keys on the decryption failure
1606
+ itself instead of error-message prefixes.
1607
+
1608
+ ## [0.7.1] - 2026-07-04
1609
+
1610
+ ECDSA signature-encoding bug fix — re-issue any ECDSA-signed artifacts
1611
+ that fail external verification.
1612
+
1613
+ ### Fixed
1614
+
1615
+ - ECDSA signing embedded an invalid signature roughly once per 256
1616
+ signatures: WebCrypto's raw `r || s` output was detected by sniffing the
1617
+ first byte for the DER SEQUENCE tag, so a raw signature whose `r` began
1618
+ with `0x30` was emitted unconverted. OpenSSL rejects such certificates
1619
+ and CRLs with a signature failure (micro509's own verifier masked the
1620
+ bug by making the mirror-image guess). Detection is now by exact raw
1621
+ length. Affects all ECDSA-signed artifacts from previous releases —
1622
+ re-issue anything that fails external verification.
1623
+
1624
+ ## [0.7.0] - 2026-07-04
1625
+
1626
+ Pre-1.0 API freeze cleanup: one coherent breaking pass over vocabulary,
1627
+ error-handling doctrine, type shapes, and export surface, so 1.0 can freeze
1628
+ a surface with no known regrets. Every rename is in the migration table
1629
+ below.
1630
+
1631
+ ### Added
1632
+
1633
+ - Runtime code arrays `REVOCATION_INDETERMINATE_REASON_CODES` and
1634
+ `REVOCATION_INDETERMINATE_REASONS` (the `VERIFY_ERROR_CODES` pattern);
1635
+ their unions now derive from the arrays.
1636
+ - The root entry point exports every type reachable from public signatures
1637
+ that were previously subpath-only (MacData, policy-validation outcome,
1638
+ identity failure details, revocation error codes/failure payloads, and
1639
+ the new `Parse*Result` / `Pem*Result` types).
1640
+ - `Pkcs7CertificateSource` and `PfxCertificateSource` accept an
1641
+ already-parsed `ParsedCertificate` (parity with the revocation source
1642
+ unions).
1643
+ - Documented error-code stability policy: unions may gain members in
1644
+ minor releases — treat them as non-exhaustive.
1645
+ - CI now smoke-tests the two previously untested runtime claims: Cloudflare
1646
+ Workers (real workerd via wrangler's test harness) and browsers (headless
1647
+ Chromium via Playwright, loading the built `dist/` output). All five
1648
+ supported runtimes are now exercised in CI.
1649
+
1650
+ ### Changed
1651
+
1652
+ Every entry in this section is **BREAKING**; the migration table at the end
1653
+ maps each old name to its replacement.
1654
+
1655
+ - **Revocation defaults to hard-fail once enabled.** Revocation checking
1656
+ remains opt-in (no evidence supplied ⇒ no check), but once `revocation`
1657
+ is passed, `policy.mode` now defaults to `'hard-fail'`: indeterminate
1658
+ status **denies**. Opt back into the old behavior explicitly with
1659
+ `policy: { mode: 'soft-fail' }`. Mental model: no revocation input → no
1660
+ check; revocation input → revocation matters.
1661
+
1662
+ - **Vocabulary unified.** The CRL/OCSP discriminant is `kind` everywhere
1663
+ (was a `kind`/`source`/`type` mix); the verifier-level can't-tell status
1664
+ is `'indeterminate'` everywhere (was `'unknown'` in standalone checks vs
1665
+ `'indeterminate'` in chain checks). Protocol-level reason codes that
1666
+ quote [RFC 6960][rfc6960]'s `unknown` certificate status keep the word
1667
+ (`ocsp_status_unknown`, `certificate_status_unknown`,
1668
+ `responder_revocation_unknown`), as does `OcspCertStatus`.
1669
+
1670
+ - **Result doctrine completed.** The last public parsers consuming
1671
+ untrusted input that still threw now return a typed `Result`
1672
+ (`code: 'malformed'`): CRL, OCSP request/response, PKCS#12 MacData, and
1673
+ the PEM primitives. Each has an `*OrThrow` twin (same convention as the
1674
+ x509 parsers since 0.3.0).
1675
+
1676
+ - **Illegal states made unrepresentable.** `ParsedPkcs7SignerInfo`
1677
+ discriminates on `hasSignedAttrs` (when `true`, `signedAttrsDer` is
1678
+ guaranteed); `CertificateRevocationStatus` is a discriminated union
1679
+ (good/revoked always carry `source`, revoked always carries `revocationInfo`,
1680
+ indeterminate always carries `indeterminateReasons`); `BasicConstraints` rejects
1681
+ `{ ca: false, pathLength }` at compile time; `ParsedPkcs12MacData.valid`
1682
+ (optional boolean tri-state) became
1683
+ `verification: 'valid' | 'invalid' | 'unchecked'`; `ParsedName.values`
1684
+ is a readonly map; `ValidateCandidatePathResult` lost its duplicate
1685
+ top-level `policyValidation`.
1686
+
1687
+ - **pkcs7 creators match the rest of the library.** `createPkcs7CertBag`
1688
+ and `createPkcs7SignedData` return a `Result` whose value is
1689
+ `{ der, pem, base64 }` material like every other creator (check `.ok`,
1690
+ then read `.value`); the `Der`/`Pem` variants are gone.
1691
+
1692
+ - **Signature-only verifiers say so.** `verifyOcspResponseSignature` /
1693
+ `verifyCertificateRevocationListSignature` check the signature only —
1694
+ the bare `verify*` names read as full validation, which is
1695
+ `validateOcspResponse` / `validateCertificateRevocationList`.
1696
+ (`verifyCertificateSigningRequest` and `verifyPkcs7SignedData` keep
1697
+ their names: each is the complete operation for its object.)
1698
+
1699
+ - **Export surface curated.** `micro509/revocation` and `micro509/verify`
1700
+ list every export explicitly (no `export type *`); dead aliases removed
1701
+ (`MatchableServiceIdentityInput`, `VerifyServiceIdentityInput`,
1702
+ `MatchServiceIdentityEvaluation` — use `ServiceIdentityInput`);
1703
+ `rethrowIfInvariant` (internal control flow) left `micro509/result`;
1704
+ `Pbes2EncryptionOptions`/`Pbes2EncryptionScheme`/`Pbes2Prf` left the
1705
+ public barrels (`EncryptedPkcs8Options` and `PfxEncryptionOptions` are
1706
+ the canonical names); the duplicate `CertificateSource` alias on the
1707
+ revocation subpath (which collided with the root-exported verify type
1708
+ under a different shape) is gone — chain inputs use
1709
+ `RevocationCertificateSource`. `IssuingDistributionPoint*` types moved
1710
+ from the x509 surface to `micro509/revocation` (they are CRL types; the
1711
+ root still exports them).
1712
+
1713
+ #### Migration table
1714
+
1715
+ | 0.6.0 | 0.7.0 |
1716
+ | -------------------------------------------------------------- | ---------------------------------------------------------- |
1717
+ | `RevocationStatus` `'unknown'` | `'indeterminate'` |
1718
+ | `RevocationCheckUnknownValue` | `RevocationCheckIndeterminateValue` |
1719
+ | `revocation_status_unknown` | `revocation_status_indeterminate` |
1720
+ | `RevocationSource.type` | `RevocationSource.kind` |
1721
+ | `RevocationCheck{Good,Revoked}Value.source` | `.kind` |
1722
+ | `RevocationIndeterminateEvidence.source` | `.kind` |
1723
+ | `revocationInfo.date` | `revocationInfo.revocationDate` |
1724
+ | `policy.mode` default `'soft-fail'` | `'hard-fail'` |
1725
+ | `verifyOcspResponse` | `verifyOcspResponseSignature` |
1726
+ | `verifyCertificateRevocationList` | `verifyCertificateRevocationListSignature` |
1727
+ | `parseCertificateRevocationList{Der,Pem}` (throwing) | Result-returning; `*OrThrow` for the old behavior |
1728
+ | `parseOcsp{Request,Response}{Der,Pem}` (throwing) | Result-returning; `*OrThrow` for the old behavior |
1729
+ | `parsePkcs12MacData` (throwing) | Result-returning; `parsePkcs12MacDataOrThrow` |
1730
+ | `pemDecode` / `splitPemBlocks` / `categorizePemBlocks` | Result-returning; `*OrThrow` for the old behavior |
1731
+ | `ParsedPkcs12MacData.valid?: boolean` | `verification: 'valid' \| 'invalid' \| 'unchecked'` |
1732
+ | `createPkcs7CertBag{Der,Pem}` | `createPkcs7CertBag` (Result of `{ der, pem, base64 }`) |
1733
+ | `createPkcs7SignedData{Der,Pem}` | `createPkcs7SignedData` (Result of `{ der, pem, base64 }`) |
1734
+ | `Pkcs7CertBag` | `Pkcs7CertBagMaterial` |
1735
+ | `Import{Rsa,Ec,Ed25519}PublicKeyInput` | `Import{Rsa,Ec,Ed25519}KeyInput` |
1736
+ | PBES2 option `encryption: 'aes256-cbc'` | `cipher: 'AES-256-CBC'` |
1737
+ | PBES2 option `prf: 'hmac-sha256'` | `prf: 'HMAC-SHA-256'` |
1738
+ | `trustedResponderCertificates` (validateOcspResponse) | `trustedOcspResponders` |
1739
+ | `delta_crl_unsupported` / `indirect_crl_unsupported` | `unsupported_delta_crl` / `unsupported_indirect_crl` |
1740
+ | `service_identity_type_unsupported` | `unsupported_service_identity_type` |
1741
+ | `service_identity_service_mismatch` | `service_identity_mismatch` |
1742
+ | `VerifyServiceIdentityInput` / `MatchableServiceIdentityInput` | `ServiceIdentityInput` |
1743
+ | `VerifyOcspResponse{Result,Failure}` | `VerifyOcspResponseSignature{Result,Failure}` |
1744
+ | `VerifyCertificateRevocationList{Result,Failure}` | `VerifyCertificateRevocationListSignature{Result,Failure}` |
1745
+
1746
+ ### Fixed
1747
+
1748
+ - Manual `npm publish` outside the release workflow now fails via a
1749
+ `prepublishOnly` guard: only the workflow rewrites the dev-only
1750
+ `bun → ./src/*.ts` export conditions, so a raw publish would ship an
1751
+ exports map pointing at files missing from the dist-only tarball.
1752
+
1753
+ ## [0.6.0] - 2026-07-04
1754
+
1755
+ Full standards surface claimed complete: all four RFC status rows — 5280,
1756
+ 6960, 6125, 9618 — now read `complete`, backed by the full NIST PKITS
1757
+ suite and RFC-exact name-constraint handling.
1758
+
1759
+ The PKITS sweep behind that claim runs the full NIST suite — all 224 test
1760
+ procedures across sections 4.1–4.16, expanded to 249 runs including every
1761
+ documented subtest variation — with every manifest expectation verified
1762
+ against the official PKITS document, now vendored as `docs/rfc/pkits.txt`.
1763
+ 4.1.4/4.1.5 (DSA chains) are expected-fail per the WebCrypto algorithm
1764
+ boundary.
1765
+
1766
+ ### Changed
1767
+
1768
+ - Name constraints now fail closed for unsupported GeneralName forms per
1769
+ [RFC 5280 §4.2.1.10][rfc5280-section-4.2.1.10]. A critical `nameConstraints` extension imposing
1770
+ `otherName`, `x400Address`, `ediPartyName`, or `registeredID`
1771
+ constraints rejects a subsequent certificate **only when a SAN of that
1772
+ form actually appears** (`unsupported_name_constraints`); previously any
1773
+ such chain was rejected outright, even when the constrained form never
1774
+ occurred. SRV-ID and unknown-tag SANs now participate in that fail-closed
1775
+ check — they were previously skipped. Unsupported forms in non-critical
1776
+ extensions are ignored, and supported forms in the same extension are
1777
+ still enforced.
1778
+
1779
+ ## [0.5.0] - 2026-07-03
1780
+
1781
+ OCSP responder authorization, URI/SRV service identities, and a
1782
+ `best-available` revocation preference that actually compares evidence
1783
+ freshness.
1784
+
1785
+ ### Added
1786
+
1787
+ - URI-ID and SRV-ID service identities are now accepted by the verification
1788
+ helpers: `VerifyServiceIdentityInput` widened to the full
1789
+ `ServiceIdentityInput` union, so
1790
+ `verifyCertificateChain({ serviceIdentity })` and `validateForTlsServer`
1791
+ match `{ type: 'uri' | 'srv' }` alongside DNS/IP. An SRV service-label
1792
+ mismatch surfaces as `subject_alt_name_mismatch` with the matcher's
1793
+ details.
1794
+
1795
+ - OCSP responder authorization completed ([RFC 6960 §4.2.2.2][rfc6960-section-4.2.2.2]):
1796
+ - `trustedResponderCertificates` on `validateOcspResponse()` and
1797
+ `trustedOcspResponders` on `checkChainRevocation()` /
1798
+ `verifyCertificateChain({ revocation })` — criterion-1 local responder
1799
+ configuration; a matching signer skips delegated issuance/EKU checks and
1800
+ is consulted during responder discovery.
1801
+ - Delegated responder revocation policy ([§4.2.2.2.1][rfc6960-section-4.2.2.2.1]):
1802
+ `responderRevocationPolicy` = `'honor-nocheck'` (default) /
1803
+ `'require-evidence'` / `'skip'` with `responderRevocationCrls` as
1804
+ evidence; chain orchestration reuses its CRLs automatically. New
1805
+ failure codes `responder_revoked` and `responder_revocation_unknown`.
1806
+ - `hasOcspNoCheckExtension()` — parses `id-pkix-ocsp-nocheck`.
1807
+ - Delegated responder chains now validate at the caller-supplied `at`
1808
+ (historical-time validation) instead of always at the current time.
1809
+
1810
+ ### Changed
1811
+
1812
+ - `policy.prefer: 'best-available'` (the default) now genuinely picks the
1813
+ freshest evidence: when CRL and OCSP both yield a validated `good`
1814
+ verdict, the source with the later `thisUpdate` is reported (an applied
1815
+ delta CRL counts as its own `thisUpdate`; ties favor OCSP). Previously
1816
+ `'best-available'` behaved identically to `'ocsp'`. Fail-closed
1817
+ combination is unchanged — a validated `revoked` verdict from either
1818
+ source still always wins.
1819
+
1820
+ - `RevocationSource` gained `thisUpdate` — the timestamp of the evidence
1821
+ backing the verdict (OCSP single-response entry or freshest contributing
1822
+ CRL), i.e. the value `'best-available'` compares. `signerCertificate` for
1823
+ a multi-CRL `good` verdict is now the freshest contributing CRL's signer
1824
+ rather than the last one processed, so it always matches the reported
1825
+ freshness.
1826
+
1827
+ ## [0.4.0] - 2026-07-03
1828
+
1829
+ OCSP joins chain-level revocation, and the npm package no longer ships
1830
+ broken Bun export conditions.
1831
+
1832
+ ### Added
1833
+
1834
+ - OCSP evidence is now consumed by chain-level revocation:
1835
+ `checkChainRevocation()` (and `verifyCertificateChain({ revocation })`)
1836
+ validates caller-supplied `ocspResponses` — signature, responder binding
1837
+ and authorization, freshness — and combines them with CRL evidence. A
1838
+ validated `revoked` verdict from either source always denies, regardless
1839
+ of `policy.prefer` (fail-closed). Delegated responder certificates can be
1840
+ supplied via `extraCertificates`.
1841
+ - `VERIFY_ERROR_CODES`: runtime array of every `VerifyErrorCode`, exported
1842
+ from the root and `micro509/verify`. The docs error-code table is now
1843
+ test-enforced against it.
1844
+ - CI now builds, validates the npm tarball against the published exports
1845
+ map, and smoke-tests the dist output under Node and Deno.
1846
+
1847
+ ### Changed
1848
+
1849
+ - **BREAKING** — `VerifyErrorCode`: renamed
1850
+ `initial_name_constraints_not_implemented` →
1851
+ `unsupported_initial_name_constraints` (it reports unsupported/malformed
1852
+ initial-name-constraint forms, not a missing feature). Removed
1853
+ `policy_processing_not_implemented`, which no code path emitted.
1854
+
1855
+ ### Fixed
1856
+
1857
+ - npm packaging: the published `exports` map retained the dev-only
1858
+ `bun → ./src/*.ts` conditions while the tarball ships only `dist/`,
1859
+ breaking Bun consumers installing from npm (`npm publish` does not apply
1860
+ `publishConfig.exports`). The publish workflow now rewrites `exports`
1861
+ from `publishConfig.exports` before publishing, and CI fails if any
1862
+ published export target is missing from the tarball.
1863
+
1864
+ ## [0.3.0] - 2026-07-02
1865
+
1866
+ Typed-error rework: trust-boundary functions (which consume untrusted
1867
+ external input) now return a `Result` as the strict, correct default,
1868
+ with an explicit `unwrap()` escape hatch. Typed-config constructors keep
1869
+ throwing (a bad config is a programmer error, not a runtime condition).
1870
+
1871
+ ### Added
1872
+
1873
+ - `unwrap(result)` / `unwrapOr(result, fallback)` (root + `micro509/result`):
1874
+ the explicit escape hatch for callers who have already validated input or
1875
+ prefer exceptions. `unwrap` throws a branded plain error carrying the
1876
+ structured `code`; `ResultError` is exported as its type and
1877
+ `isResultError(error)` is the guard. There is no class to `instanceof` —
1878
+ the library ships no classes.
1879
+ - `failureResult(code, message, details?)` factory in `micro509/result`:
1880
+ one source of truth for the `{ ok, error, code, message }` shape.
1881
+ - `rethrowIfInvariant(error)` in `micro509/result`: the guard the parse
1882
+ wrappers use to keep programmer errors out of `Result` failures (removed
1883
+ from the public barrel in 0.7.0).
1884
+
1885
+ ### Changed
1886
+
1887
+ - **BREAKING** — `parseCertificateDer`, `parseCertificatePem`,
1888
+ `parseCertificateSigningRequestDer`, `parseCertificateSigningRequestPem`
1889
+ now return a `Result` (`{ ok, value }` / `{ ok, error: { code:
1890
+ 'malformed' } }`) instead of throwing. Wrap with `unwrap(...)` for the
1891
+ previous throw-on-error behavior.
1892
+ - **BREAKING** — All 16 key `import*` functions now return a `Result` instead
1893
+ of throwing. Non-encrypted failures use code `'malformed'`; encrypted
1894
+ imports distinguish a typed `'invalid_password'` from `'malformed'`.
1895
+ `export*` and `generateKeyPair` are unchanged (no untrusted input).
1896
+ - **BREAKING** — `createPfx`, `createPkcs7CertBagDer`, and
1897
+ `createPkcs7CertBagPem` now return a `Result` (code
1898
+ `'invalid_certificate'`) instead of throwing on a malformed certificate
1899
+ source — matching `createPkcs7SignedData`. Pure typed-config constructors
1900
+ (`createCertificate`, `createSelfSignedCertificate`,
1901
+ `createCertificateRevocationList`, …) still throw: a bad config is a
1902
+ programmer error, not a runtime result.
1903
+ - Canonical docs site is now `micro509.kjanat.dev` (was `micro509.kjanat.com`,
1904
+ which stays live as a mirror). `homepage` and all documentation links point at
1905
+ the `.dev` domain.
1906
+ - GitHub repository renamed `kjanat/ts-x509` → `kjanat/micro509` to match the
1907
+ published package name. `repository.url` updated; old URLs redirect.
1908
+
1909
+ ### Fixed
1910
+
1911
+ - The new parse `Result` wrappers rethrow a `TypeError`, `RangeError`,
1912
+ `ReferenceError`, or `SyntaxError` raised inside a parser instead of
1913
+ reporting it as a `'malformed'` failure, so a genuine crash surfaces as a
1914
+ crash rather than masquerading as bad input.
1915
+
1916
+ ## [0.2.0] - 2026-06-29
1917
+
1918
+ ### Added
1919
+
1920
+ - PKCS#7 / CMS `SignedData` creation (`createPkcs7SignedDataDer`,
1921
+ `createPkcs7SignedDataPem`): sign content with one or more signers via the
1922
+ [RFC 5652 §5.4][rfc5652-section-5.4] signed-attributes flow (`contentType` + `messageDigest`),
1923
+ producing attached SignedData that round-trips through
1924
+ `verifyPkcs7SignedData`. The content digest is selected per signer key:
1925
+ SHA-256 for ECDSA P-256 and RSA-SHA256, SHA-384 for P-384, and SHA-512
1926
+ for P-521 and Ed25519 (the latter per [RFC 8419][rfc8419]). Returns a typed result
1927
+ (`no_signers` / `invalid_signer_certificate` / `unsupported_signer_key`)
1928
+ for caller-correctable input.
1929
+
1930
+ ## [0.1.1] - 2026-06-29
1931
+
1932
+ Maintenance release — release-pipeline fixes only, no library changes.
1933
+
1934
+ ### Fixed
1935
+
1936
+ - Publish workflow is gated on the test suite, authenticates npm via OIDC
1937
+ trusted publishing, and emits correct JSR/npm release URLs.
1938
+
1939
+ ## [0.1.0] - 2026-06-29
1940
+
1941
+ Initial prerelease. API may change before 1.0.
1942
+
1943
+ ### Added
1944
+
1945
+ - X.509 certificate and CSR creation, parsing, and self-signing.
1946
+ - Certificate chain verification with typed results (21 error codes, failing
1947
+ certificate index, structured failure details) and [RFC 6125][rfc6125] service-identity
1948
+ matching (DNS, IPv6, URI-ID, SRV-ID, explicit CN opt-in).
1949
+ - Revocation: CRL create/parse/verify/status and OCSP request building plus
1950
+ response parsing and responder-authorization checks.
1951
+ - PKCS#7 / CMS `SignedData` parsing and signer-signature verification.
1952
+ - PFX / PKCS#12 create and parse (PBES2, PKCS#12 KDF, HMAC-SHA-256 MAC).
1953
+ - PEM handling and key import/export (PKCS#8, SPKI, JWK, PKCS#1, SEC1) with
1954
+ generation for RSA, ECDSA (`P-256`/`P-384`/`P-521`), and Ed25519.
1955
+ - Zero runtime dependencies, WebCrypto-native, tree-shakeable subpath exports;
1956
+ runs on Node, Bun, Deno, browsers, and Cloudflare Workers.
1957
+
1958
+ [Unreleased]: https://github.com/kjanat/micro509/compare/v0.16.0...HEAD
1959
+ [0.16.0]: https://github.com/kjanat/micro509/compare/v0.15.0...v0.16.0
1960
+ [0.15.0]: https://github.com/kjanat/micro509/compare/v0.14.0...v0.15.0
1961
+ [0.14.0]: https://github.com/kjanat/micro509/compare/v0.13.0...v0.14.0
1962
+ [0.13.0]: https://github.com/kjanat/micro509/compare/v0.12.0...v0.13.0
1963
+ [0.12.0]: https://github.com/kjanat/micro509/compare/v0.11.0...v0.12.0
1964
+ [0.11.0]: https://github.com/kjanat/micro509/compare/v0.10.0...v0.11.0
1965
+ [0.10.0]: https://github.com/kjanat/micro509/compare/v0.9.0...v0.10.0
1966
+ [0.9.0]: https://github.com/kjanat/micro509/compare/v0.8.0...v0.9.0
1967
+ [0.8.0]: https://github.com/kjanat/micro509/compare/v0.7.2...v0.8.0
1968
+ [0.7.2]: https://github.com/kjanat/micro509/compare/v0.7.1...v0.7.2
1969
+ [0.7.1]: https://github.com/kjanat/micro509/compare/v0.7.0...v0.7.1
1970
+ [0.7.0]: https://github.com/kjanat/micro509/compare/v0.6.0...v0.7.0
1971
+ [0.6.0]: https://github.com/kjanat/micro509/compare/v0.5.0...v0.6.0
1972
+ [0.5.0]: https://github.com/kjanat/micro509/compare/v0.4.0...v0.5.0
1973
+ [0.4.0]: https://github.com/kjanat/micro509/compare/v0.3.0...v0.4.0
1974
+ [0.3.0]: https://github.com/kjanat/micro509/compare/v0.2.0...v0.3.0
1975
+ [0.2.0]: https://github.com/kjanat/micro509/compare/v0.1.1...v0.2.0
1976
+ [0.1.1]: https://github.com/kjanat/micro509/compare/v0.1.0...v0.1.1
1977
+ [0.1.0]: https://github.com/kjanat/micro509/releases/tag/v0.1.0
1978
+ [rfc822]: https://www.rfc-editor.org/rfc/rfc822.html
1979
+ [rfc822-section-3.1.1]: https://www.rfc-editor.org/rfc/rfc822.html#section-3.1.1
1980
+ [rfc822-section-3.3]: https://www.rfc-editor.org/rfc/rfc822.html#section-3.3
1981
+ [rfc1034-section-3.5]: https://www.rfc-editor.org/rfc/rfc1034.html#section-3.5
1982
+ [rfc1421-section-4.6]: https://www.rfc-editor.org/rfc/rfc1421.html#section-4.6
1983
+ [rfc2315]: https://www.rfc-editor.org/rfc/rfc2315.html
1984
+ [rfc2315-section-7]: https://www.rfc-editor.org/rfc/rfc2315.html#section-7
1985
+ [rfc2315-section-9.1]: https://www.rfc-editor.org/rfc/rfc2315.html#section-9.1
1986
+ [rfc2315-section-9.3]: https://www.rfc-editor.org/rfc/rfc2315.html#section-9.3
1987
+ [rfc2985-page-17]: https://www.rfc-editor.org/rfc/rfc2985.html#page-17
1988
+ [rfc2986]: https://www.rfc-editor.org/rfc/rfc2986.html
1989
+ [rfc2986-page-5]: https://www.rfc-editor.org/rfc/rfc2986.html#page-5
1990
+ [rfc2986-page-7]: https://www.rfc-editor.org/rfc/rfc2986.html#page-7
1991
+ [rfc3261-section-19.1]: https://www.rfc-editor.org/rfc/rfc3261.html#section-19.1
1992
+ [rfc3261-section-25.1]: https://www.rfc-editor.org/rfc/rfc3261.html#section-25.1
1993
+ [rfc3454]: https://www.rfc-editor.org/rfc/rfc3454.html
1994
+ [rfc3454-appendix-B.2]: https://www.rfc-editor.org/rfc/rfc3454.html#appendix-B.2
1995
+ [rfc3490-section-2]: https://www.rfc-editor.org/rfc/rfc3490.html#section-2
1996
+ [rfc3490-section-3.1]: https://www.rfc-editor.org/rfc/rfc3490.html#section-3.1
1997
+ [rfc3986]: https://www.rfc-editor.org/rfc/rfc3986.html
1998
+ [rfc3986-section-3.2]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2
1999
+ [rfc3986-section-3.2.1]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.1
2000
+ [rfc3986-section-3.2.2]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3.2.2
2001
+ [rfc3986-section-3.3]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
2002
+ [rfc3986-section-3.5]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3.5
2003
+ [rfc3986-section-6]: https://www.rfc-editor.org/rfc/rfc3986.html#section-6
2004
+ [rfc3987-section-2.2]: https://www.rfc-editor.org/rfc/rfc3987.html#section-2.2
2005
+ [rfc4055-section-5]: https://www.rfc-editor.org/rfc/rfc4055.html#section-5
2006
+ [rfc4514]: https://www.rfc-editor.org/rfc/rfc4514.html
2007
+ [rfc4518]: https://www.rfc-editor.org/rfc/rfc4518.html
2008
+ [rfc4518-appendix-A]: https://www.rfc-editor.org/rfc/rfc4518.html#appendix-A
2009
+ [rfc4518-section-2.1]: https://www.rfc-editor.org/rfc/rfc4518.html#section-2.1
2010
+ [rfc4518-section-2.6.1]: https://www.rfc-editor.org/rfc/rfc4518.html#section-2.6.1
2011
+ [rfc4519]: https://www.rfc-editor.org/rfc/rfc4519.html
2012
+ [rfc4556]: https://www.rfc-editor.org/rfc/rfc4556.html
2013
+ [rfc4648-section-4]: https://www.rfc-editor.org/rfc/rfc4648.html#section-4
2014
+ [rfc4985-section-2]: https://www.rfc-editor.org/rfc/rfc4985.html#section-2
2015
+ [rfc4985-section-3]: https://www.rfc-editor.org/rfc/rfc4985.html#section-3
2016
+ [rfc4985-section-4]: https://www.rfc-editor.org/rfc/rfc4985.html#section-4
2017
+ [rfc5280]: https://www.rfc-editor.org/rfc/rfc5280.html
2018
+ [rfc5280-appendix-A.1]: https://www.rfc-editor.org/rfc/rfc5280.html#appendix-A.1
2019
+ [rfc5280-section-3.2]: https://www.rfc-editor.org/rfc/rfc5280.html#section-3.2
2020
+ [rfc5280-section-3.3]: https://www.rfc-editor.org/rfc/rfc5280.html#section-3.3
2021
+ [rfc5280-section-4.1.1.2]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.1.1.2
2022
+ [rfc5280-section-4.1.2.2]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.1.2.2
2023
+ [rfc5280-section-4.1.2.4]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.1.2.4
2024
+ [rfc5280-section-4.1.2.6]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.1.2.6
2025
+ [rfc5280-section-4.2]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2
2026
+ [rfc5280-section-4.2.1.2]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.2
2027
+ [rfc5280-section-4.2.1.3]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.3
2028
+ [rfc5280-section-4.2.1.4]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.4
2029
+ [rfc5280-section-4.2.1.6]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.6
2030
+ [rfc5280-section-4.2.1.7]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.7
2031
+ [rfc5280-section-4.2.1.9]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.9
2032
+ [rfc5280-section-4.2.1.10]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.10
2033
+ [rfc5280-section-4.2.1.12]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.12
2034
+ [rfc5280-section-4.2.1.13]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.1.13
2035
+ [rfc5280-section-4.2.2.1]: https://www.rfc-editor.org/rfc/rfc5280.html#section-4.2.2.1
2036
+ [rfc5280-section-5]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5
2037
+ [rfc5280-section-5.1.1.2]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.1.1.2
2038
+ [rfc5280-section-5.1.2.3]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.1.2.3
2039
+ [rfc5280-section-5.1.2.5]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.1.2.5
2040
+ [rfc5280-section-5.2.1]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.2.1
2041
+ [rfc5280-section-5.2.3]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.2.3
2042
+ [rfc5280-section-5.2.4]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.2.4
2043
+ [rfc5280-section-5.3]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.3
2044
+ [rfc5280-section-5.3.1]: https://www.rfc-editor.org/rfc/rfc5280.html#section-5.3.1
2045
+ [rfc5280-section-6.1.3]: https://www.rfc-editor.org/rfc/rfc5280.html#section-6.1.3
2046
+ [rfc5280-section-6.1.4]: https://www.rfc-editor.org/rfc/rfc5280.html#section-6.1.4
2047
+ [rfc5280-section-6.3.3]: https://www.rfc-editor.org/rfc/rfc5280.html#section-6.3.3
2048
+ [rfc5280-section-7.1]: https://www.rfc-editor.org/rfc/rfc5280.html#section-7.1
2049
+ [rfc5280-section-7.2]: https://www.rfc-editor.org/rfc/rfc5280.html#section-7.2
2050
+ [rfc5280-section-7.4]: https://www.rfc-editor.org/rfc/rfc5280.html#section-7.4
2051
+ [rfc5280-section-7.5]: https://www.rfc-editor.org/rfc/rfc5280.html#section-7.5
2052
+ [rfc5480-section-2.1.1]: https://www.rfc-editor.org/rfc/rfc5480.html#section-2.1.1
2053
+ [rfc5652]: https://www.rfc-editor.org/rfc/rfc5652.html
2054
+ [rfc5652-section-5.1]: https://www.rfc-editor.org/rfc/rfc5652.html#section-5.1
2055
+ [rfc5652-section-5.2]: https://www.rfc-editor.org/rfc/rfc5652.html#section-5.2
2056
+ [rfc5652-section-5.4]: https://www.rfc-editor.org/rfc/rfc5652.html#section-5.4
2057
+ [rfc5652-section-10.2.2]: https://www.rfc-editor.org/rfc/rfc5652.html#section-10.2.2
2058
+ [rfc5754-section-2]: https://www.rfc-editor.org/rfc/rfc5754.html#section-2
2059
+ [rfc5890]: https://www.rfc-editor.org/rfc/rfc5890.html
2060
+ [rfc5893]: https://www.rfc-editor.org/rfc/rfc5893.html
2061
+ [rfc5895]: https://www.rfc-editor.org/rfc/rfc5895.html
2062
+ [rfc5895-section-2]: https://www.rfc-editor.org/rfc/rfc5895.html#section-2
2063
+ [rfc5915]: https://www.rfc-editor.org/rfc/rfc5915.html
2064
+ [rfc5915-section-3]: https://www.rfc-editor.org/rfc/rfc5915.html#section-3
2065
+ [rfc5922-section-7.1]: https://www.rfc-editor.org/rfc/rfc5922.html#section-7.1
2066
+ [rfc5922-section-7.2]: https://www.rfc-editor.org/rfc/rfc5922.html#section-7.2
2067
+ [rfc5922-section-7.3]: https://www.rfc-editor.org/rfc/rfc5922.html#section-7.3
2068
+ [rfc5958-section-2]: https://www.rfc-editor.org/rfc/rfc5958.html#section-2
2069
+ [rfc6125]: https://www.rfc-editor.org/rfc/rfc6125.html
2070
+ [rfc6335]: https://www.rfc-editor.org/rfc/rfc6335.html
2071
+ [rfc6335-section-5.1]: https://www.rfc-editor.org/rfc/rfc6335.html#section-5.1
2072
+ [rfc6531]: https://www.rfc-editor.org/rfc/rfc6531.html
2073
+ [rfc6806]: https://www.rfc-editor.org/rfc/rfc6806.html
2074
+ [rfc6818-section-3]: https://www.rfc-editor.org/rfc/rfc6818.html#section-3
2075
+ [rfc6960]: https://www.rfc-editor.org/rfc/rfc6960.html
2076
+ [rfc6960-appendix-B.1]: https://www.rfc-editor.org/rfc/rfc6960.html#appendix-B.1
2077
+ [rfc6960-section-4.2.2.1]: https://www.rfc-editor.org/rfc/rfc6960.html#section-4.2.2.1
2078
+ [rfc6960-section-4.2.2.2]: https://www.rfc-editor.org/rfc/rfc6960.html#section-4.2.2.2
2079
+ [rfc6960-section-4.2.2.2.1]: https://www.rfc-editor.org/rfc/rfc6960.html#section-4.2.2.2.1
2080
+ [rfc7292]: https://www.rfc-editor.org/rfc/rfc7292.html
2081
+ [rfc7292-appendix-B]: https://www.rfc-editor.org/rfc/rfc7292.html#appendix-B
2082
+ [rfc7292-appendix-B.1]: https://www.rfc-editor.org/rfc/rfc7292.html#appendix-B.1
2083
+ [rfc7292-section-4]: https://www.rfc-editor.org/rfc/rfc7292.html#section-4
2084
+ [rfc7468]: https://www.rfc-editor.org/rfc/rfc7468.html
2085
+ [rfc7468-section-2]: https://www.rfc-editor.org/rfc/rfc7468.html#section-2
2086
+ [rfc7468-section-3]: https://www.rfc-editor.org/rfc/rfc7468.html#section-3
2087
+ [rfc7468-section-6]: https://www.rfc-editor.org/rfc/rfc7468.html#section-6
2088
+ [rfc7468-section-7]: https://www.rfc-editor.org/rfc/rfc7468.html#section-7
2089
+ [rfc7468-section-8]: https://www.rfc-editor.org/rfc/rfc7468.html#section-8
2090
+ [rfc7468-section-9]: https://www.rfc-editor.org/rfc/rfc7468.html#section-9
2091
+ [rfc7468-section-14]: https://www.rfc-editor.org/rfc/rfc7468.html#section-14
2092
+ [rfc8018-appendix-A.2]: https://www.rfc-editor.org/rfc/rfc8018.html#appendix-A.2
2093
+ [rfc8018-section-4.1]: https://www.rfc-editor.org/rfc/rfc8018.html#section-4.1
2094
+ [rfc8410-section-5]: https://www.rfc-editor.org/rfc/rfc8410.html#section-5
2095
+ [rfc8410-section-7]: https://www.rfc-editor.org/rfc/rfc8410.html#section-7
2096
+ [rfc8410-section-8]: https://www.rfc-editor.org/rfc/rfc8410.html#section-8
2097
+ [rfc8410-section-10.1]: https://www.rfc-editor.org/rfc/rfc8410.html#section-10.1
2098
+ [rfc8410-section-10.2]: https://www.rfc-editor.org/rfc/rfc8410.html#section-10.2
2099
+ [rfc8410-section-12]: https://www.rfc-editor.org/rfc/rfc8410.html#section-12
2100
+ [rfc8419]: https://www.rfc-editor.org/rfc/rfc8419.html
2101
+ [rfc8753]: https://www.rfc-editor.org/rfc/rfc8753.html
2102
+ [rfc9525-section-2]: https://www.rfc-editor.org/rfc/rfc9525.html#section-2
2103
+ [rfc9525-section-6.3]: https://www.rfc-editor.org/rfc/rfc9525.html#section-6.3
2104
+ [rfc9525-section-6.4]: https://www.rfc-editor.org/rfc/rfc9525.html#section-6.4
2105
+ [rfc9549]: https://www.rfc-editor.org/rfc/rfc9549.html
2106
+ [rfc9549-section-1]: https://www.rfc-editor.org/rfc/rfc9549.html#section-1
2107
+ [rfc9549-section-2.2]: https://www.rfc-editor.org/rfc/rfc9549.html#section-2.2
2108
+ [rfc9549-section-2.3]: https://www.rfc-editor.org/rfc/rfc9549.html#section-2.3
2109
+ [rfc9598]: https://www.rfc-editor.org/rfc/rfc9598.html
2110
+ [rfc9598-section-3]: https://www.rfc-editor.org/rfc/rfc9598.html#section-3
2111
+ [rfc9598-section-6]: https://www.rfc-editor.org/rfc/rfc9598.html#section-6
2112
+ [rfc9608]: https://www.rfc-editor.org/rfc/rfc9608.html
2113
+ [rfc9608-section-4]: https://www.rfc-editor.org/rfc/rfc9608.html#section-4
2114
+ [rfc9618]: https://www.rfc-editor.org/rfc/rfc9618.html
2115
+ [rfc9618-section-5.5]: https://www.rfc-editor.org/rfc/rfc9618.html#section-5.5
2116
+ [rfc9879]: https://www.rfc-editor.org/rfc/rfc9879.html
2117
+ [rfc9919]: https://www.rfc-editor.org/rfc/rfc9919.html
2118
+ [rfc9919-section-5]: https://www.rfc-editor.org/rfc/rfc9919.html#section-5
2119
+ [rfc10007-section-4]: https://www.rfc-editor.org/rfc/rfc10007.html#section-4