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