@blamejs/pki 0.7.22 → 0.7.23
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.
- package/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/lib/constants.js +1 -0
- package/lib/inspect.js +20 -1
- package/lib/ocsp-verify.js +8 -2
- package/lib/pki-build.js +45 -4
- package/lib/schema-pkix.js +40 -4
- package/lib/x509-sign.js +21 -0
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ All notable changes to `@blamejs/pki` are documented here. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this
|
|
5
5
|
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## v0.7.23 — 2026-09-11
|
|
8
|
+
|
|
9
|
+
Subject information access, subject directory attributes and the OCSP no-check marker are read and written.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- extensions.subjectInfoAccess takes the same { accessMethod, accessLocation } list authorityInfoAccess takes, because RFC 5280 section 4.2.2.2 gives it section 4.2.2.1's syntax. The two access methods that section defines are the registered names id-ad-caRepository and id-ad-timeStamping; the latter is a different object identifier from the extended-key-usage timeStamping, and naming the wrong one is the mistake this spelling avoids.
|
|
14
|
+
- extensions.subjectDirectoryAttributes takes a list of { type, values } with each value as pre-encoded DER, which is the form its reader surfaces (RFC 5280 section 4.2.1.8). Both extensions are emitted non-critical, which those sections require of a conforming CA, and a pre-encoded instance marked critical is refused on both signers.
|
|
15
|
+
- extensions.ocspNoCheck marks an OCSP responder certificate so a client does not ask about its own revocation (RFC 6960 section 4.2.2.2.1). The value is NULL, which that section requires, and the extension is emitted non-critical, which it says it should be.
|
|
16
|
+
- All three join the shared certificate-extension decoders. pki.lint.certificate reads them, so a malformed value is graded lint/rfc5280/extension-undecodable instead of passing unexamined, and pki.inspect prints the access method and location, the attribute and its value, and the no-check marker, where it previously printed a hex dump. That brings the set of certificate extensions the toolkit decodes and the set it can issue to the same twenty-six.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- pki.ocsp.verify authorized a delegated responder whose ocspNoCheck extension carried something other than NULL. The extension is what lets a client stop asking whether the responder itself is revoked, and the delegation gate tested only that it was present, so a responder certificate carrying a malformed marker was accepted and could return a good verdict. The gate now decodes the extension, as it already did for the key usage and extended key usage beside it, and a responder whose marker is not the NULL RFC 6960 section 4.2.2.2.1 requires is unauthorized. A conforming responder certificate is unaffected.
|
|
21
|
+
|
|
7
22
|
## v0.7.22 — 2026-09-11
|
|
8
23
|
|
|
9
24
|
A CRL can name its issuer's other identities.
|
package/README.md
CHANGED
|
@@ -208,7 +208,7 @@ comment blocks, is at [pkijs.com](https://pkijs.com).
|
|
|
208
208
|
| `pki.webcrypto` | A W3C `SubtleCrypto` engine over `node:crypto` — `sign`/`verify`/`encrypt`/`decrypt`/`deriveBits`/`digest`/`generateKey`/`importKey`/`exportKey` across RSA, ECDSA, ECDH, Ed25519/Ed448, AES, HMAC, HKDF, PBKDF2 and SHA, plus post-quantum ML-DSA-44/65/87, SLH-DSA, and ML-KEM-512/768/1024 key generation with certificate and PKCS#8 import. The RFC 9935 seed / expandedKey / both private-key CHOICE is validated fail-closed, so an OpenSSL-legacy bare seed or an internally inconsistent key is rejected with a typed error. `encapsulateBits` and `decapsulateBits` are the ML-KEM key-establishment pair the CMS `KEMRecipientInfo` arm rides on, with the FIPS 203 §7.3 ciphertext-length check enforced here so a direct caller inherits it. Cross-implementation use is undefined in the specification, so a `CryptoKey` from a different WebCrypto implementation is refused here with a typed fault naming its origin; the `pki.*` verbs adopt such a key instead, whether it came from the platform or from a separately installed copy of this toolkit |
|
|
209
209
|
| `pki.tls` | RFC 8879 certificate compression and the RFC 8446 §4.4.2 Certificate message it carries, which is the handshake's largest payload. `decompressCertificate` decodes a `CompressedCertificate` and returns the algorithm, the declared uncompressed length, the recovered message raw, and its per-entry certificate DER. Decompression carries the two-sided bound §5 requires: capped at the message's own declared length so a bomb is refused mid-stream, then compared to that declaration exactly, which catches the under-length direction a cap alone cannot see. An algorithm outside the RFC 8879 registry, one the runtime cannot decompress, or one the receiver never advertised is refused before any decompressor is handed the bytes; an empty compressed body is a framing violation (`tls/bad-framing`); and trailing bytes, after the message or after the compressed frame, are refused (`tls/trailing-data`), so one chain has exactly one encoding. `compressCertificate` is the inverse and round-trips its own output before returning. `parseCertificateMessage` decodes the RFC 8446 §4.4.2 message on its own, surfacing each entry's certificate DER ready for `pki.schema.x509.parse` alongside its raw extensions; a separate extension negotiates `certificate_type`, so it is declared, never guessed. All three registered algorithms (zlib, brotli, zstd) are implemented, each offered only where the running Node decompresses it safely — one whose decompressor answers a truncated frame with a short result instead of a fault is dropped at startup rather than advertised with a truncation it cannot detect. Structure only: no handshake is spoken and no certificate verified — `decompressCertificate`, `compressCertificate`, `parseCertificateMessage` |
|
|
210
210
|
| `pki.schema` | The schema family. `parse` detects which PKI format a DER or PEM input encodes and routes it to the right parser; `all` enumerates the registered formats; the engine and per-format members are grouped here |
|
|
211
|
-
| `pki.schema.x509` | Certificates (RFC 5280) parsed into structured, validated fields with
|
|
211
|
+
| `pki.schema.x509` | Certificates (RFC 5280) parsed into structured, validated fields. Each extension is surfaced by name with its `extnValue` bytes; the shared extension decoders that read those bytes are what `pki.lint.certificate`, `pki.inspect` and `pki.path.validate` consume, and they cover the RFC 3739 / ETSI EN 319 412-5 qualified-certificate `qcStatements` (EU-qualified declaration, reliance limit, QSCD flag, certificate type, retention, PDS URLs, country of qualification), the Microsoft Active Directory Certificate Services enrollment extensions (certificate template, CA version, previous-CA-certificate hash, application policies), subject information access, subject directory attributes, and the RFC 6960 OCSP no-check responder marker. Unknown statements stay opaque, fail-closed Fail-closed — `parse`, `pemDecode`, `pemEncode` |
|
|
212
212
|
| `pki.schema.c509` | C509 certificates (draft-ietf-cose-cbor-encoded-cert), the compact CBOR profile of X.509, decoded fail-closed under deterministic CBOR. `encode` is the byte-exact inverse: a DER X.509 v3 certificate forward-transforms to a compact type-3 C509 whose reconstruction reproduces the original DER byte for byte, so the original signature still verifies. A `parse` result re-emits its native array in canonical deterministic CBOR, with the registry integer shorthands, the C509 compressions, and the compact draft-20 per-extension value forms: the scalar extensions (keyUsage, basicConstraints, extended key usage, subject key identifier, inhibitAnyPolicy, OCSP No Check, TLS Feature), the general-name-bearing extensions (subjectAltName, issuer alternative name, name constraints, CRL distribution points, freshest CRL, authority and subject information access, and the full authority key identifier) over one shared GeneralNames codec, certificate policies with their CPS-URI and UserNotice qualifiers, policy mappings and policy constraints, subject directory attributes, and the RFC 3779 resource-delegation extensions (IP address blocks and AS identifiers) with their RFC 8360 v2 twins, whose addresses ride either the delta-coded integer form or the byte-string form the specification mandates once an address exceeds eight octets. A value the compact form cannot carry exactly falls back to the byte-string form with its bytes intact; a certificate outside the invertible set throws a typed `C509Error`. Called explicitly, since it is CBOR rather than DER and so is not auto-routed |
|
|
213
213
|
| `pki.schema.crl` | X.509 CRLs (RFC 5280 §5): revoked serials with real-`Date` revocation times, named and partly decoded extensions Fail-closed — `parse`, `pemDecode`, `pemEncode` |
|
|
214
214
|
| `pki.schema.csr` | PKCS#10 certification requests (RFC 2986): subject DN, public key, requested attributes, signature Fail-closed — `parse`, `pemDecode`, `pemEncode` |
|
|
@@ -231,7 +231,7 @@ comment blocks, is at [pkijs.com](https://pkijs.com).
|
|
|
231
231
|
| `pki.schema.cmc` | Decode CMC messages (RFC 5272 as updated by RFC 6402): a Full PKI Request (`PKIData`) or Full PKI Response (`PKIResponse`) riding inside a CMS SignedData, reached by the encapsulated content type (`id-cct-PKIData` / `id-cct-PKIResponse`). Controls are surfaced in wire order with their values raw, so an unrecognized one is data rather than a fault. Tagged requests decode across all three arms. The status verdicts (`CMCStatusInfo` v1 and `CMCStatusInfoV2`) are collected as an ordered list, and the RFC 6402 two-module `OtherStatusInfo` ambiguity — `pendInfo` and `extendedFailInfo` are both untagged SEQUENCEs in the 1988 module, told apart only by their first element — is resolved by inspection and refused when it cannot be told apart. Body-part identity is unique across the whole message rather than per sequence, 0 is reserved as the reference to the enclosing PKIData, and the `reqSequence` bytes are surfaced exactly as they appeared so an Identity Proof witness is computed over the wire bytes. A companion decoder for CMS content rather than an auto-routed format — `parse`, `parsePkiData`, `parsePkiResponse` |
|
|
232
232
|
| `pki.schema.engine` | The declarative ASN.1 structure-schema engine every format parser composes — `walk`, `encode`, `embeddedDer`, and the schema combinators |
|
|
233
233
|
| `pki.path` | Certification-path validation (RFC 5280 §6). `validate` runs the §6.1 state machine over an ordered path and a trust anchor: signature chaining across RSA, ECDSA, EdDSA, ML-DSA, SLH-DSA and hybrid composite ML-DSA (a composite is accepted only when both its post-quantum and traditional components verify), validity windows, name chaining, basic constraints and path length, key usage, name constraints, and the certificate-policy tree. It returns a structured verdict with per-check reason codes and enforces a `pki.trust` anchor's per-purpose distrust-after dates and delegator purposes through `checkPurpose` — an anchor that carries either one with no purpose named to select by is refused as a configuration fault rather than validated as though it carried none. The verdict says what was established. `revocationChecked` takes the weakest outcome on the path: `false` with no checker supplied, `"determined"` when every certificate got an explicit good or revoked answer, `"waived"` when `softFail` turned an undetermined one into a pass, and `"undetermined"` when one could not be answered at all — which includes a checker that throws, a fault `softFail` does not waive because `softFail` opts into an undetermined answer, not into a broken checker. `anchorConstraints` names the purpose the anchor was judged under and whether each of its two constraints applied. `crlChecker` supplies CRL-based revocation, covering partitioned and sharded CRLs, whose §6.3.3 Distribution Point ↔ IDP correspondence lets corresponding shards accumulate reason coverage until all eight revocation reasons are covered, and delta CRLs, merged onto the complete CRL they may be combined with (§5.2.4) so a held certificate its delta releases reads good, while a delta that merges with nothing still reports what it lists and still withholds good. `ocspChecker` supplies OCSP-based revocation (RFC 6960: CertID binding, responder authorization, signature, currency) over the same pluggable hook. `build(leaf, opts)` is the discovering complement (RFC 4158): from a leaf, an untrusted pool of candidate CA certificates, and a trust store, it finds the ordered leaf-to-anchor path `validate` accepts, using name chaining plus the RFC 4158 §3.5 sort hints (an AKI/SKI match, an anchor-adjacent issuer, CA plus keyCertSign, validity at the check time — ordering hints, never filters), a depth-first search with backtracking so the first accepted path wins, and a bounded search (chain-length cap, candidate-expansion cap, identity-tuple visited set) so a cross-certificate cycle or Bridge-CA fan-out terminates deterministically. Every accept flows through `validate`, and its verdict is cross-checked against `openssl verify`. Opt-in AIA `caIssuers` fetching (`opts.fetchAia: true`) discovers a missing intermediate from a certificate's Authority Information Access URL (§4.2.2.1) over `pki.transport`, triggered only on a pool miss and bounded against SSRF and amplification: HTTPS only, a total fetch budget that caps fetching silently rather than throwing, a per-cert URL cap, a build-wide URL dedupe, a response-size and certificate-count cap, no redirect following, and every fault a silent skip. The TLS trust (`opts.tls`) stays distinct from the PKI `trustAnchors`, and every fetched certificate remains untrusted pool material that still flows through `validate` (never a trust anchor). It is off by default, so the default build is byte-identical offline. An `opts.direction` of `"reverse"` searches from a trust anchor toward the leaf (RFC 4158 §3.1), narrower when the anchor set is small and the leaf's issuer options fan out, and `"auto"` picks the direction by first-hop fan-out; reverse building reuses the same pool, visited set, caps, and `validate` gate, so the direction changes only search order, and the anchor is excluded from the returned path. Reverse building is pool-only and does not combine with `fetchAia`. When `opts.userInitialPolicySet` names acceptable certificate-policy OIDs and more than one path validates, build returns the accepted path whose user-constrained policy set best satisfies that set (RFC 4158 §4) rather than the first accepted path, the ranking bounded by the same candidate cap and a malformed set refused with `path/bad-input`; an `anyPolicy` entry is unconstrained and returns the first accepted path. In a mesh of cross-certified domains, where many candidates chain by name to the same place, a candidate is ranked by how many leading relative distinguished names it shares with the name the search is heading for (§3.5.16 and the §3.5.19 reverse method), so a certificate in the target's own domain is tried before one from a cross-certified domain, and forward building sorts a candidate under every candidate that can complete the path when its path length constraint cannot cover the certificates already below it (§3.5.7), an ordering that outranks the other hints rather than competing with them. No candidate is removed and an unbounded search still reaches every path the pool holds; a bounded one spends `maxCandidatesConsidered` on whichever branches the order steers it to. Pure and re-entrant — `validate`, `build`, `crlChecker`, `ocspChecker` |
|
|
234
|
-
| `pki.x509` | Certificate issuance (RFC 5280 §4). `sign(spec, issuer, opts)` builds and signs a certificate from a `spec` of subject (a common-name string, an array of RDNs, or raw Name DER), the public key being certified, the validity window, an optional serial, and an optional `extensions` object. `randomSerial()` draws the same 20-octet CSPRNG serial the signer uses when the spec names none, so a serial can be reserved or logged before the certificate is issued. The `issuer` is a key alone (self-signed: issuer equals subject, signed with that key), a name plus public key plus key, or an issuing certificate plus key. The signature algorithm is resolved from the signing key through the shared registry, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA P-256/384/521, Ed25519, Ed448, ML-DSA-44/65/87, the twelve SLH-DSA sets, and the composite arms all issue without a per-algorithm branch. It encodes basic constraints, key usage, extended key usage, subject and authority key identifiers (the SKI derived by SHA-1 of the subject key; the AKI optionally naming the issuing certificate by name and serial), subject alternative names, certificate policies with their RFC 5280 section 4.2.1.4 qualifiers (a CPS pointer and a user notice), name constraints, authority information access, CRL distribution points, the freshest CRL, issuer alternative names, the policy machinery path validation acts on (policy constraints, inhibit anyPolicy, policy mappings), the RFC 3739 qualified-certificate statements including the ETSI EN 319 412-5 set, the RFC 6962 certificate-transparency pair (the precertificate poison and the embedded SCT list),
|
|
234
|
+
| `pki.x509` | Certificate issuance (RFC 5280 §4). `sign(spec, issuer, opts)` builds and signs a certificate from a `spec` of subject (a common-name string, an array of RDNs, or raw Name DER), the public key being certified, the validity window, an optional serial, and an optional `extensions` object. `randomSerial()` draws the same 20-octet CSPRNG serial the signer uses when the spec names none, so a serial can be reserved or logged before the certificate is issued. The `issuer` is a key alone (self-signed: issuer equals subject, signed with that key), a name plus public key plus key, or an issuing certificate plus key. The signature algorithm is resolved from the signing key through the shared registry, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA P-256/384/521, Ed25519, Ed448, ML-DSA-44/65/87, the twelve SLH-DSA sets, and the composite arms all issue without a per-algorithm branch. It encodes basic constraints, key usage, extended key usage, subject and authority key identifiers (the SKI derived by SHA-1 of the subject key; the AKI optionally naming the issuing certificate by name and serial), subject alternative names, certificate policies with their RFC 5280 section 4.2.1.4 qualifiers (a CPS pointer and a user notice), name constraints, authority information access, CRL distribution points, the freshest CRL, issuer alternative names, the policy machinery path validation acts on (policy constraints, inhibit anyPolicy, policy mappings), the RFC 3739 qualified-certificate statements including the ETSI EN 319 412-5 set, the RFC 6962 certificate-transparency pair (the precertificate poison and the embedded SCT list), the Active Directory Certificate Services enrollment extensions (certificate template, legacy template name, CA version, previous-CA-certificate hash, application policies), subject information access, subject directory attributes, and the RFC 6960 OCSP no-check responder marker, from the spec. That is every extension the shared certificate-extension decoders read, so any certificate `pki.lint.certificate` and `pki.inspect` can read in full the toolkit can also issue; any other extension is taken as pre-encoded DER. `extensions.nameConstraints` takes `{ permitted, excluded }` lists of GeneralName-form objects, restricting what the CA being issued may itself issue; each base is held to the rule for a constraint base, and the extension is emitted critical as §4.2.1.10 requires. It derives the version from the field set and enforces the serial bounds, the UTCTime/GeneralizedTime cutover, the DER default omissions, and the CA cross-field rules; a violation throws a typed `CertificateError`. Returns DER, or a PEM `CERTIFICATE` with `opts.pem`. Every arm is independently verified by OpenSSL. Parsing stays at `pki.schema.x509.parse` — `sign` |
|
|
235
235
|
| `pki.csr` | PKCS#10 certification-request issuance (RFC 2986 / RFC 2985). `sign(spec, key, opts)` builds and signs a `CertificationRequest` from a `spec` of subject (which may be empty), the public key being certified, an optional `extensionRequest` carrying the requested v3 extensions a CA copies into the issued certificate (subject alternative names, key usage, extended key usage, basic constraints, certificate policies, subject key identifier, the RFC 3739 qualified-certificate statements, or an array of pre-encoded Extension DER), and an optional `challengePassword`. `key` (or `{ key }`) is the subject's own private key: the request is self-signed to prove possession of the private half of `subjectPublicKey`, and that proof is verified before the request is returned, which is what `openssl req -verify` checks. The signature algorithm is resolved from the subject key, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch. Returns DER, or a PEM `CERTIFICATE REQUEST` with `opts.pem`; malformed input throws a typed `CsrError`. `verify(request)` asks the same question of a request someone else produced, over its exact signed `certificationRequestInfo` bytes under the `subjectPKInfo` inside them, through the one path-validation signature engine. It answers `{ verified, subject, subjectPublicKeyInfo, attributes, certificationRequestInfoBytes }`, all re-derived from the signed bytes, so a CA issues from the fields the signature covers rather than from the object it passed in. A `verified: true` says the producer held that private key and that the subject and requested extensions are the ones they signed; who they are is the enrollment protocol's question, not this one. Parsing stays at `pki.schema.csr.parse` — `sign`, `verify` |
|
|
236
236
|
| `pki.attrcert` | Attribute-certificate issuance (RFC 5755). `sign(spec, issuer, opts)` builds and signs an `AttributeCertificate` as an Attribute Authority: a `spec` of `holder` (exactly one of an entity name, a `baseCertificateID` reference, a `fromCertificate` binding, or an object digest), the validity window as GeneralizedTime, an optional serial (positive, at most 20 octets, randomly generated when omitted), the `attributes` (role, clearance, group, chargingIdentity, accessIdentity, authenticationInfo, or pre-encoded Attribute DER), and optional `extensions` (auditIdentity, targetInformation, noRevAvail, aaControls, acProxying, authorityKeyIdentifier, or pre-encoded Extension DER) each with its RFC 5755 criticality. An attribute certificate is never self-signed, so the `issuer` is the signing AA, supplied as `{ cert, key }` or `{ name, publicKey, key }`. The signature algorithm is resolved from the AA key, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch, and the signature is verified under the AA public key before the certificate is returned. Returns DER, or a PEM `ATTRIBUTE CERTIFICATE` with `opts.pem`; malformed input throws a typed `AttrCertError`. `verify(ac, issuer, opts)` is the receiving side, performing the RFC 5755 sec. 5 checks an attribute certificate and a named issuer can settle between them: the signature over the exact `AttributeCertificateInfo` bytes through the one path-validation signature engine, the AC naming the issuer this verifier trusts (compared as a distinguished name), the evaluation instant lying within the validity with equality at either bound succeeding as the section states, the sec. 4.3.2 targeting rule, and rejection of any critical extension this verb does not process (section 5 defines support as parsing the value AND rejecting where the value would reject, so `aaControls` and `acProxying`, whose constraints it does not evaluate, are refused when critical). It answers `{ verified, signatureValid, validityChecked, targetingChecked, holderBindingChecked, issuerPathChecked, holder, issuer, attributes, extensions, notBefore, notAfter, serialNumberHex, reason }` with the fields re-derived from the signed bytes; the holder's own certificate chain and the AC issuer's chain need certificates the verb is not given, so those slots report `false` rather than letting their absence read as a pass. Parsing stays at `pki.schema.attrcert.parse` — `sign`, `verify` |
|
|
237
237
|
| `pki.crmf` | Certificate-request-message issuance (RFC 4211). `build(spec, key, opts)` assembles a `CertReqMessages` from a `spec` of `certReqId` (default 0, with the RFC 9483 `-1` sentinel allowed), a `certTemplate` of the requested fields (`subject`, `publicKey` as the SPKI DER of the key being certified, `validity`, requested `extensions`, an optional `version` 2), optional `controls` and `regInfo` (regToken, authenticator, utf8Pairs, oldCertID, protocolEncrKey, or pre-encoded `AttributeTypeAndValue` DER), and an optional `pop` selector. `key` (or `{ key }`) is the requester's private key: the message carries a `POPOSigningKey` proof of possession signed with the private half of `certTemplate.publicKey` and verified before the message is returned, exactly as a PKCS#10 CSR proves possession. A complete template signs the `CertRequest`; an incomplete one signs a `POPOSigningKeyInput`. The signature algorithm is resolved from the requested public key, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch. `key` is optional for a `raVerified` proof. A key that cannot sign, which is where an ML-KEM enrollment sits, takes a `POPOPrivKey` proof instead (RFC 4211 sec. 4.2, sec. 4.3): `pop.type` of `keyEncipherment` or `keyAgreement` with `pop.method: 'subsequentMessage'` declares whether an encrypted certificate (`encrCert`) or a challenge (`challengeResp`) completes the proof over the enrolling protocol's next exchange, and `pop.method: 'encryptedKey'` encloses the requester's private key for the CA in a CMS `EnvelopedData` under `id-ct-encKeyWithID`, requiring `pop.privateKey`, `pop.recipients`, the `pop.identifier` sec. 4.2.1 makes mandatory, and `pop.archive: true` because RFC 9810 sec. 5.2.8.3.1 permits the method only where archival is intended. The enclosed key must be the private half of `certTemplate.publicKey`, or the proof demonstrates possession of a key the request never asked to have certified. The `thisMessage` and `dhMAC` alternatives the specification deprecates are refused with their successors named. `pop.method: 'agreeMAC'` completes the four: `pop.key` is the requester's finite-field Diffie-Hellman private key, as a PKCS#8 DER, a PEM `PRIVATE KEY` block or a `KeyObject`, and `pop.caCert` the authority's certificate it already holds; the two agree a static secret (RFC 2875 sec. 3), and the key derived from it MACs the DER `certReq` under `id-dhPop-static-HMAC-SHA1`. Either key may name its group in the PKCS#3 or the X9.42 encoding. `pop.key` must be the private half of `certTemplate.publicKey`, and the template must name both a subject and a public key. Pass an array of specs for a batch; the CA-assigned template fields are never emitted. Returns DER, or a PEM block with `opts.pem`; malformed input throws a typed `CrmfError`. `verifyPop(messages)` is the receiving side: for each `CertReqMsg` it verifies the `POPOSigningKey` signature over the bytes RFC 4211 sec. 4.1 names — the DER of `poposkInput` when present, of `certReq` when not — through the one path-validation signature engine, and answers `{ verified, messages: [{ verified, method, cryptographicallyVerified, certReqId, subject, subjectBound, publicKey, reason }] }` with the fields re-derived from the message's own bytes. Each verdict reports only what its preimage covers: `publicKey` is the key possession was proven for, and `subject` is the requested name when the `certReq` was signed. A `poposkInput` preimage covers the key and the sender alone, so any subject beside it is unsigned and is withheld with `subjectBound: false`. A `raVerified` proof is an RA's out-of-band assertion and a `keyEncipherment` or `keyAgreement` proof completes over a later exchange, so each is reported unverified with its `method` named instead of guessed. Parsing stays at `pki.schema.crmf.parse` — `build`, `verifyPop` |
|
package/lib/constants.js
CHANGED
|
@@ -205,6 +205,7 @@ var NAMES = Object.assign(Object.create(null), {
|
|
|
205
205
|
issuingDistributionPoint: "X509v3 Issuing Distribution Point", cRLReason: "X509v3 CRL Reason Code",
|
|
206
206
|
invalidityDate: "Invalidity Date", certificateIssuer: "X509v3 Certificate Issuer",
|
|
207
207
|
signedCertificateTimestampList: "CT Precertificate SCTs", precertificatePoison: "CT Precertificate Poison",
|
|
208
|
+
subjectDirectoryAttributes: "X509v3 Subject Directory Attributes", ocspNoCheck: "OCSP No Check",
|
|
208
209
|
},
|
|
209
210
|
KEY_USAGE: {
|
|
210
211
|
digitalSignature: "Digital Signature", nonRepudiation: "Non Repudiation", keyEncipherment: "Key Encipherment",
|
package/lib/inspect.js
CHANGED
|
@@ -301,7 +301,10 @@ var EXT_RENDERERS = Object.assign(Object.create(null), {
|
|
|
301
301
|
cRLDistributionPoints: _renderCrlDp,
|
|
302
302
|
freshestCRL: _renderCrlDp,
|
|
303
303
|
authorityInfoAccess: function (decoded, inner) {
|
|
304
|
-
var LABEL = Object.assign(Object.create(null), {
|
|
304
|
+
var LABEL = Object.assign(Object.create(null), {
|
|
305
|
+
caIssuers: "CA Issuers", ocsp: "OCSP",
|
|
306
|
+
"id-ad-caRepository": "CA Repository", "id-ad-timeStamping": "Time Stamping",
|
|
307
|
+
});
|
|
305
308
|
return (decoded || []).map(function (ad) {
|
|
306
309
|
var m = null;
|
|
307
310
|
try { m = oid.name(ad.accessMethod); } catch (_e) { /* allow:swallow-unverified display best-effort: an unregistered accessMethod OID falls back to the raw dotted OID below (inspection is best-effort, never a verdict) */ }
|
|
@@ -352,6 +355,22 @@ var EXT_RENDERERS = Object.assign(Object.create(null), {
|
|
|
352
355
|
precertificatePoison: function (decoded, inner) {
|
|
353
356
|
return inner + "Precertificate Poison (this is a precertificate, not a certificate)";
|
|
354
357
|
},
|
|
358
|
+
/** @internal RFC 5280 sec. 4.2.2.2 gives subjectInfoAccess sec. 4.2.2.1's AccessDescription
|
|
359
|
+
* syntax, so it renders through the same rows; only the access methods it names differ. */
|
|
360
|
+
subjectInfoAccess: function (decoded, inner) {
|
|
361
|
+
return EXT_RENDERERS.authorityInfoAccess(decoded, inner);
|
|
362
|
+
},
|
|
363
|
+
/** @internal Each Attribute value is raw DER, so it renders through the same best-effort value
|
|
364
|
+
* fallback every other opaque value uses rather than a second reading of the same bytes. */
|
|
365
|
+
subjectDirectoryAttributes: function (decoded, inner) {
|
|
366
|
+
return (decoded || []).map(function (a) {
|
|
367
|
+
var lines = (a.values || []).map(function (v) { return _fallback(v, inner + " "); });
|
|
368
|
+
return inner + (a.name || a.type) + ":" + (lines.length ? "\n" + lines.join("\n") : "");
|
|
369
|
+
}).join("\n");
|
|
370
|
+
},
|
|
371
|
+
ocspNoCheck: function (decoded, inner) {
|
|
372
|
+
return inner + "OCSP No Check (this is an OCSP responder certificate; do not check its revocation)";
|
|
373
|
+
},
|
|
355
374
|
subjectKeyIdentifier: function (decoded, inner) {
|
|
356
375
|
return inner + _hexColon(Buffer.isBuffer(decoded) ? decoded : (decoded.bytes || Buffer.alloc(0)), { upper: true });
|
|
357
376
|
},
|
package/lib/ocsp-verify.js
CHANGED
|
@@ -34,7 +34,6 @@ function ocspKeyValue(spkiDer) {
|
|
|
34
34
|
function makeOcspVerify(deps) {
|
|
35
35
|
var verifyWithSpki = deps.verifyWithSpki;
|
|
36
36
|
var decodeExt = deps.decodeExt;
|
|
37
|
-
var findExt = deps.findExt;
|
|
38
37
|
var unrecognizedCriticalExtension = deps.unrecognizedCriticalExtension;
|
|
39
38
|
var validateCriticalExtensionStructure = deps.validateCriticalExtensionStructure;
|
|
40
39
|
var compositeKeyUsageCheck = deps.compositeKeyUsageCheck;
|
|
@@ -112,7 +111,14 @@ function makeOcspVerify(deps) {
|
|
|
112
111
|
if (ku && ku.value.digitalSignature !== true) continue;
|
|
113
112
|
if (unrecognizedCriticalExtension(rc, false)) continue;
|
|
114
113
|
if (validateCriticalExtensionStructure(rc)) continue;
|
|
115
|
-
|
|
114
|
+
/** @internal RFC 6960 sec. 4.2.2.2.1 gives this extension a value that SHALL be NULL, and its
|
|
115
|
+
* presence is what lets a client stop asking whether the responder itself is revoked. A
|
|
116
|
+
* malformed value is not that marker, so this decodes the extension, as the key usage and
|
|
117
|
+
* extended key usage checks above do. */
|
|
118
|
+
var noCheck;
|
|
119
|
+
try { noCheck = decodeExt(rc, OID_OCSP_NOCHECK); }
|
|
120
|
+
catch (_e) { continue; }
|
|
121
|
+
if (!noCheck) continue;
|
|
116
122
|
if (compositeSig.COMPOSITE_ALGS[rc.subjectPublicKeyInfo.algorithm.oid] && !compositeKeyUsageCheck(rc).ok) continue;
|
|
117
123
|
return ocspResponderSpki(rc, issuer);
|
|
118
124
|
}
|
package/lib/pki-build.js
CHANGED
|
@@ -12,6 +12,7 @@ var _isArray = intrinsic.isArray;
|
|
|
12
12
|
var _bufferFrom = intrinsic.bufferFrom;
|
|
13
13
|
var _bufferEquals = intrinsic.bufferEquals;
|
|
14
14
|
var oid = require("./oid");
|
|
15
|
+
var C = require("./constants");
|
|
15
16
|
var pkix = require("./schema-pkix");
|
|
16
17
|
var ipUtils = require("./ip-utils");
|
|
17
18
|
var _packIpLiteral = ipUtils.packIpLiteral;
|
|
@@ -274,6 +275,7 @@ var AKI_KEYS = intrinsic.assign(intrinsic.create(null), { keyIdentifier: 1, auth
|
|
|
274
275
|
* are proprietary, so the toolkit's own readers in schema-pkix define the shape the builder emits. */
|
|
275
276
|
var MS_TEMPLATE_KEYS = intrinsic.assign(intrinsic.create(null), { templateID: 1, templateMajorVersion: 1, templateMinorVersion: 1 });
|
|
276
277
|
var MS_CA_VERSION_KEYS = intrinsic.assign(intrinsic.create(null), { caKeyIndex: 1, certIndex: 1 });
|
|
278
|
+
var SDA_ATTR_KEYS = intrinsic.assign(intrinsic.create(null), { type: 1, values: 1 });
|
|
277
279
|
/** @internal The fields each typed statementInfo defines, by statement id. A key outside its
|
|
278
280
|
* statement's set is refused rather than ignored: a misspelled field would otherwise be dropped and
|
|
279
281
|
* the certificate would carry a statement the caller did not write. */
|
|
@@ -735,13 +737,16 @@ function makeBuilder(ctx) {
|
|
|
735
737
|
}
|
|
736
738
|
/** @internal AuthorityInfoAccessSyntax (RFC 5280 sec. 4.2.2.1): SEQUENCE SIZE (1..MAX) OF
|
|
737
739
|
* AccessDescription { accessMethod OBJECT IDENTIFIER, accessLocation GeneralName }. */
|
|
738
|
-
|
|
740
|
+
/** @internal Sec. 4.2.2.1 and sec. 4.2.2.2 define the same SEQUENCE SIZE (1..MAX) OF
|
|
741
|
+
* AccessDescription, so one encoder serves both and is told which structure it is writing: a fault
|
|
742
|
+
* in a subjectInfoAccess must not be reported against authorityInfoAccess. */
|
|
743
|
+
function extAccessDescriptions(list, label, clause) {
|
|
739
744
|
if (!_isArray(list) || !list.length) {
|
|
740
|
-
throw E("bad-input", "
|
|
745
|
+
throw E("bad-input", label + " must name at least one { accessMethod, accessLocation } (" + clause + ")");
|
|
741
746
|
}
|
|
742
|
-
var dense = reqDenseArray(list,
|
|
747
|
+
var dense = reqDenseArray(list, label);
|
|
743
748
|
return b.sequence(_mapIntrinsic(dense, function (d, i) {
|
|
744
|
-
var who = "
|
|
749
|
+
var who = label + " entry " + i;
|
|
745
750
|
if (!d || typeof d !== "object" || _isArray(d) || _isBufferChk(d)) {
|
|
746
751
|
throw E("bad-input", who + " must be an object { accessMethod, accessLocation }");
|
|
747
752
|
}
|
|
@@ -758,6 +763,41 @@ function makeBuilder(ctx) {
|
|
|
758
763
|
return b.sequence([b.oid(_resolveOid(d.accessMethod, who + " accessMethod")), encodeGeneralName(d.accessLocation)]);
|
|
759
764
|
}));
|
|
760
765
|
}
|
|
766
|
+
function extAuthorityInfoAccess(list) {
|
|
767
|
+
return extAccessDescriptions(list, "authorityInfoAccess", "RFC 5280 sec. 4.2.2.1");
|
|
768
|
+
}
|
|
769
|
+
function extSubjectInfoAccess(list) {
|
|
770
|
+
return extAccessDescriptions(list, "subjectInfoAccess", "RFC 5280 sec. 4.2.2.2");
|
|
771
|
+
}
|
|
772
|
+
/** @internal SubjectDirectoryAttributes ::= SEQUENCE SIZE (1..MAX) OF Attribute (RFC 5280
|
|
773
|
+
* sec. 4.2.1.8). The reader surfaces each value as its raw DER, so the spec supplies it the same
|
|
774
|
+
* way and the two directions describe one structure. */
|
|
775
|
+
function extSubjectDirectoryAttributes(list) {
|
|
776
|
+
if (!_isArray(list) || !list.length) {
|
|
777
|
+
throw E("bad-input", "subjectDirectoryAttributes must name at least one { type, values } (RFC 5280 sec. 4.2.1.8)");
|
|
778
|
+
}
|
|
779
|
+
var dense = reqDenseArray(list, "subjectDirectoryAttributes");
|
|
780
|
+
return b.sequence(_mapIntrinsic(dense, function (a, i) {
|
|
781
|
+
var who = "subjectDirectoryAttributes entry " + i;
|
|
782
|
+
if (!a || typeof a !== "object" || _isArray(a) || _isBufferChk(a)) {
|
|
783
|
+
throw E("bad-input", who + " must be an object { type, values }");
|
|
784
|
+
}
|
|
785
|
+
guard.identifier.assertKnownKeys(a, SDA_ATTR_KEYS, E, "bad-input", function (k) {
|
|
786
|
+
return "unknown " + who + " field " + _stringify(k) + " (accepted: type, values)";
|
|
787
|
+
});
|
|
788
|
+
if (!_isArray(a.values) || !a.values.length) throw E("bad-input", who + " requires a non-empty values array of pre-encoded DER");
|
|
789
|
+
/** @internal The reader caps an Attribute's values, so the writer is held to the same ceiling
|
|
790
|
+
* and cannot emit an attribute this toolkit's own decoder refuses. */
|
|
791
|
+
if (a.values.length > C.LIMITS.ATTRIBUTE_MAX_VALUES) {
|
|
792
|
+
throw E("bad-input", who + " carries " + a.values.length + " values, exceeding the " + C.LIMITS.ATTRIBUTE_MAX_VALUES + " an Attribute may hold");
|
|
793
|
+
}
|
|
794
|
+
var vals = _mapIntrinsic(reqDenseArray(a.values, who + " values"), function (v, j) {
|
|
795
|
+
return b.raw(guard.der.tlv(guard.bytes.source(v, ErrorClass, ctx.prefix + "/bad-input", who + " value " + j),
|
|
796
|
+
rawErr, ctx.prefix + "/bad-input", who + " value " + j));
|
|
797
|
+
});
|
|
798
|
+
return b.sequence([b.oid(_resolveOid(a.type, who + " type")), b.set(vals)]);
|
|
799
|
+
}));
|
|
800
|
+
}
|
|
761
801
|
/** @internal One DistributionPoint (RFC 5280 sec. 4.2.1.13). distributionPoint [0] wraps a
|
|
762
802
|
* DistributionPointName whose fullName is [0] IMPLICIT GeneralNames; reasons is [1] IMPLICIT
|
|
763
803
|
* ReasonFlags; cRLIssuer is [2] IMPLICIT GeneralNames. A DistributionPoint must not consist of
|
|
@@ -1206,6 +1246,7 @@ function makeBuilder(ctx) {
|
|
|
1206
1246
|
extKeyUsage: extKeyUsage, extExtKeyUsage: extExtKeyUsage, validateBcSpec: validateBcSpec,
|
|
1207
1247
|
extBasicConstraints: extBasicConstraints, pathLen: pathLen, extSki: extSki, extAki: extAki, AKI_KEYS: AKI_KEYS,
|
|
1208
1248
|
extSan: extSan, extCertPolicies: extCertPolicies, ext: ext,
|
|
1249
|
+
extSubjectInfoAccess: extSubjectInfoAccess, extSubjectDirectoryAttributes: extSubjectDirectoryAttributes,
|
|
1209
1250
|
extMsCertificateTemplate: extMsCertificateTemplate, extMsCaVersion: extMsCaVersion,
|
|
1210
1251
|
extMsPreviousCertHash: extMsPreviousCertHash, extMsEnrollCertType: extMsEnrollCertType,
|
|
1211
1252
|
spkiKeyId: spkiKeyId, skiKeyId: skiKeyId,
|
package/lib/schema-pkix.js
CHANGED
|
@@ -942,14 +942,17 @@ function certExtensionDecoders(ns) {
|
|
|
942
942
|
return schema.walk(generalNames(ns, { decodeValue: true, code: C }), n, ns).result;
|
|
943
943
|
}
|
|
944
944
|
|
|
945
|
-
|
|
945
|
+
/** @internal Sec. 4.2.2.1 and sec. 4.2.2.2 define the same SEQUENCE SIZE (1..MAX) OF
|
|
946
|
+
* AccessDescription, so one reader serves both and takes the structure's own name and clause: a
|
|
947
|
+
* fault in a SubjectInfoAccess must not be reported against AuthorityInfoAccess. */
|
|
948
|
+
function accessDescriptions(buf, what, clause) {
|
|
946
949
|
var C = ns.prefix + "/bad-extension-value";
|
|
947
|
-
var descs = seqChildren(buf, C,
|
|
948
|
-
if (descs.length < 1) throw ns.E(C, "
|
|
950
|
+
var descs = seqChildren(buf, C, what);
|
|
951
|
+
if (descs.length < 1) throw ns.E(C, what + " must contain at least one AccessDescription (" + clause + ", SIZE(1..MAX))");
|
|
949
952
|
var GN = generalName(ns, { decodeValue: true, code: C });
|
|
950
953
|
return _map(descs, function (d) {
|
|
951
954
|
if (d.tagClass !== "universal" || d.tagNumber !== _T.SEQUENCE || !d.children || d.children.length !== 2) {
|
|
952
|
-
throw ns.E(C, "AccessDescription must be a SEQUENCE { accessMethod, accessLocation } (
|
|
955
|
+
throw ns.E(C, "AccessDescription must be a SEQUENCE { accessMethod, accessLocation } (" + clause + ")");
|
|
953
956
|
}
|
|
954
957
|
var method;
|
|
955
958
|
try { method = asn1.read.oid(d.children[0]); }
|
|
@@ -958,6 +961,36 @@ function certExtensionDecoders(ns) {
|
|
|
958
961
|
return { accessMethod: method, accessLocation: { tag: loc.tagNumber, value: loc.value } };
|
|
959
962
|
});
|
|
960
963
|
}
|
|
964
|
+
function authorityInfoAccess(buf) {
|
|
965
|
+
return accessDescriptions(buf, "AuthorityInfoAccessSyntax", "RFC 5280 sec. 4.2.2.1");
|
|
966
|
+
}
|
|
967
|
+
function subjectInfoAccess(buf) {
|
|
968
|
+
return accessDescriptions(buf, "SubjectInfoAccessSyntax", "RFC 5280 sec. 4.2.2.2");
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/** @internal SubjectDirectoryAttributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
|
|
972
|
+
* (RFC 5280 sec. 4.2.1.8), read through the shared Attribute sub-schema. */
|
|
973
|
+
function subjectDirectoryAttributes(buf) {
|
|
974
|
+
var C = ns.prefix + "/bad-extension-value";
|
|
975
|
+
var kids = seqChildren(buf, C, "SubjectDirectoryAttributes");
|
|
976
|
+
if (kids.length < 1) throw ns.E(C, "SubjectDirectoryAttributes must contain at least one Attribute (RFC 5280 sec. 4.2.1.8, SIZE(1..MAX))");
|
|
977
|
+
var A = attribute(ns);
|
|
978
|
+
return _map(kids, function (k) {
|
|
979
|
+
try { return schema.walk(A, k, ns).result; }
|
|
980
|
+
catch (e) { throw ns.E(C, "SubjectDirectoryAttributes member must be an Attribute SEQUENCE { type, values } (RFC 5280 sec. 4.2.1.8)", e); }
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/** @internal RFC 6960 sec. 4.2.2.2.1: "The value of the extension SHALL be NULL." The extension is
|
|
985
|
+
* a marker, so a successful read carries no value and anything other than a bare NULL is refused. */
|
|
986
|
+
function ocspNoCheck(buf) {
|
|
987
|
+
var C = ns.prefix + "/bad-extension-value";
|
|
988
|
+
var n = decodeTop(buf, C, "OCSPNoCheck");
|
|
989
|
+
if (n.tagClass !== "universal" || n.tagNumber !== _T.NULL || n.length !== 0) {
|
|
990
|
+
throw ns.E(C, "the ocspNoCheck extension value SHALL be NULL (RFC 6960 sec. 4.2.2.2.1)");
|
|
991
|
+
}
|
|
992
|
+
return null;
|
|
993
|
+
}
|
|
961
994
|
|
|
962
995
|
function extKeyUsage(buf) {
|
|
963
996
|
var C = ns.prefix + "/bad-extension-value";
|
|
@@ -1203,6 +1236,9 @@ function certExtensionDecoders(ns) {
|
|
|
1203
1236
|
byOid[O("cRLDistributionPoints")] = crlDistributionPoints;
|
|
1204
1237
|
byOid[O("freshestCRL")] = crlDistributionPoints;
|
|
1205
1238
|
byOid[O("authorityInfoAccess")] = authorityInfoAccess;
|
|
1239
|
+
byOid[O("subjectInfoAccess")] = subjectInfoAccess;
|
|
1240
|
+
byOid[O("subjectDirectoryAttributes")] = subjectDirectoryAttributes;
|
|
1241
|
+
byOid[O("ocspNoCheck")] = ocspNoCheck;
|
|
1206
1242
|
byOid[O("msCertificateTemplate")] = msCertificateTemplate;
|
|
1207
1243
|
byOid[O("msEnrollCertType")] = msEnrollCertType;
|
|
1208
1244
|
byOid[O("msCaVersion")] = msCaVersion;
|
package/lib/x509-sign.js
CHANGED
|
@@ -58,6 +58,7 @@ var KNOWN_EXT_KEYS = intrinsic.assign(intrinsic.create(null), {
|
|
|
58
58
|
precertificatePoison: 1, signedCertificateTimestampList: 1,
|
|
59
59
|
msCertificateTemplate: 1, msEnrollCertType: 1, msCaVersion: 1, msPreviousCertHash: 1,
|
|
60
60
|
msApplicationPolicies: 1,
|
|
61
|
+
subjectInfoAccess: 1, subjectDirectoryAttributes: 1, ocspNoCheck: 1,
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
var _b = pkiBuild.makeBuilder({ ErrorClass: CertificateError, prefix: "x509", O: O, NS: NS, NAME_SCHEMA: NAME_SCHEMA, SPKI_SCHEMA: SPKI_SCHEMA, EXT_DECODERS: EXT_DECODERS });
|
|
@@ -232,6 +233,16 @@ function _buildExtensions(extSpec, ctx) {
|
|
|
232
233
|
if (extSpec.msCaVersion != null) guard.list.append(out, _ext(O("msCaVersion"), false, _b.extMsCaVersion(extSpec.msCaVersion)));
|
|
233
234
|
if (extSpec.msPreviousCertHash != null) guard.list.append(out, _ext(O("msPreviousCertHash"), false, _b.extMsPreviousCertHash(extSpec.msPreviousCertHash)));
|
|
234
235
|
if (extSpec.msApplicationPolicies != null) guard.list.append(out, _ext(O("msApplicationPolicies"), false, _extCertPolicies(extSpec.msApplicationPolicies)));
|
|
236
|
+
/** @internal Sections 4.2.2.2 and 4.2.1.8 both require a conforming CA to mark these non-critical,
|
|
237
|
+
* which `assertCertCriticality` also holds the pre-encoded form to. */
|
|
238
|
+
if (extSpec.subjectInfoAccess != null) guard.list.append(out, _ext(O("subjectInfoAccess"), false, _b.extSubjectInfoAccess(extSpec.subjectInfoAccess)));
|
|
239
|
+
if (extSpec.subjectDirectoryAttributes != null) guard.list.append(out, _ext(O("subjectDirectoryAttributes"), false, _b.extSubjectDirectoryAttributes(extSpec.subjectDirectoryAttributes)));
|
|
240
|
+
/** @internal RFC 6960 sec. 4.2.2.2.1 marks an OCSP responder certificate so a client does not ask
|
|
241
|
+
* about its revocation: the value SHALL be NULL, and the section says it should be non-critical. */
|
|
242
|
+
if (extSpec.ocspNoCheck != null) {
|
|
243
|
+
if (extSpec.ocspNoCheck !== true) throw _err("x509/bad-input", "ocspNoCheck is a flag, so it is true or omitted");
|
|
244
|
+
guard.list.append(out, _ext(O("ocspNoCheck"), false, asn1.build.nullValue()));
|
|
245
|
+
}
|
|
235
246
|
return out;
|
|
236
247
|
}
|
|
237
248
|
|
|
@@ -400,6 +411,16 @@ function _hasCriticalSan(extSpec) {
|
|
|
400
411
|
* know an unknown syntax. `pki.path.validate` does not process this extension, so it is emitted
|
|
401
412
|
* non-critical unless `qcStatementsCritical` is set.
|
|
402
413
|
*
|
|
414
|
+
* `extensions.subjectInfoAccess` takes the same `{ accessMethod, accessLocation }` list
|
|
415
|
+
* `authorityInfoAccess` takes, since RFC 5280 sec. 4.2.2.2 gives it sec. 4.2.2.1's syntax; the two
|
|
416
|
+
* access methods that section defines are the registered names `id-ad-caRepository` and
|
|
417
|
+
* `id-ad-timeStamping`, the latter being a different OID from the extended-key-usage `timeStamping`.
|
|
418
|
+
* `extensions.subjectDirectoryAttributes` takes a list of `{ type, values }` with each value as
|
|
419
|
+
* pre-encoded DER, the form its reader surfaces (sec. 4.2.1.8). Both are emitted non-critical, which
|
|
420
|
+
* those sections require. `extensions.ocspNoCheck: true` marks an OCSP responder certificate so a
|
|
421
|
+
* client does not ask about its revocation (RFC 6960 sec. 4.2.2.2.1): the value is NULL, as that
|
|
422
|
+
* section requires, and it is emitted non-critical, which the section says it should be.
|
|
423
|
+
*
|
|
403
424
|
* The Active Directory Certificate Services enrollment extensions are written from the same spec.
|
|
404
425
|
* `extensions.msCertificateTemplate` takes `{ templateID, templateMajorVersion, templateMinorVersion }`,
|
|
405
426
|
* the versions optional and each a DWORD, a minor version requiring a major one;
|
package/package.json
CHANGED
package/sbom.cdx.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.5",
|
|
5
|
-
"serialNumber": "urn:uuid:
|
|
5
|
+
"serialNumber": "urn:uuid:d0937d40-1cca-4e77-9a29-1835e7a8ae04",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-09-
|
|
8
|
+
"timestamp": "2026-09-12T00:20:25.960Z",
|
|
9
9
|
"lifecycles": [
|
|
10
10
|
{
|
|
11
11
|
"phase": "build"
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"component": {
|
|
22
|
-
"bom-ref": "@blamejs/pki@0.7.
|
|
22
|
+
"bom-ref": "@blamejs/pki@0.7.23",
|
|
23
23
|
"type": "application",
|
|
24
24
|
"name": "pki",
|
|
25
|
-
"version": "0.7.
|
|
25
|
+
"version": "0.7.23",
|
|
26
26
|
"scope": "required",
|
|
27
27
|
"author": "blamejs contributors",
|
|
28
28
|
"description": "Pure-JavaScript PKI toolkit that owns its stack — X.509, ASN.1/DER, CMS, PQC-first.",
|
|
29
|
-
"purl": "pkg:npm/%40blamejs/pki@0.7.
|
|
29
|
+
"purl": "pkg:npm/%40blamejs/pki@0.7.23",
|
|
30
30
|
"properties": [],
|
|
31
31
|
"externalReferences": [
|
|
32
32
|
{
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"components": [],
|
|
55
55
|
"dependencies": [
|
|
56
56
|
{
|
|
57
|
-
"ref": "@blamejs/pki@0.7.
|
|
57
|
+
"ref": "@blamejs/pki@0.7.23",
|
|
58
58
|
"dependsOn": []
|
|
59
59
|
}
|
|
60
60
|
]
|