@blamejs/pki 0.8.57 → 0.8.59

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/lib/key.js CHANGED
@@ -48,6 +48,10 @@ var _floor = intrinsic.floor;
48
48
  var _isFinite = intrinsic.isFinite;
49
49
  var _String = intrinsic.String;
50
50
  var _toUpperCase = intrinsic.toUpperCase;
51
+ /** @internal The walk over an array LITERAL is captured too. The receiver is the literal rather than
52
+ * a caller's value, but the method is still read off the live prototype at the moment it runs, and a
53
+ * replacement decides which rows of a registry this module builds. */
54
+ var _forEach = intrinsic.forEach;
51
55
  var _strIndexOf = intrinsic.stringIndexOf;
52
56
 
53
57
  var b = asn1.build;
@@ -60,13 +64,13 @@ function _err(code, msg, cause) { return new KeyError(code, msg, cause); }
60
64
  var CIPHER_NAME = _assign(_create(null), { "aes-128-cbc": "aes128-CBC", "aes-192-cbc": "aes192-CBC", "aes-256-cbc": "aes256-CBC" });
61
65
 
62
66
  var INFER_ALG = _create(null);
63
- ["Ed25519", "Ed448", "X25519", "X448"].forEach(function (n) { INFER_ALG[O(n)] = { name: n }; });
64
- [["id-ml-dsa-44", "ML-DSA-44"], ["id-ml-dsa-65", "ML-DSA-65"], ["id-ml-dsa-87", "ML-DSA-87"],
65
- ["id-ml-kem-512", "ML-KEM-512"], ["id-ml-kem-768", "ML-KEM-768"], ["id-ml-kem-1024", "ML-KEM-1024"]
66
- ].forEach(function (r) { INFER_ALG[O(r[0])] = { name: r[1] }; });
67
- ["sha2-128s", "sha2-128f", "sha2-192s", "sha2-192f", "sha2-256s", "sha2-256f",
68
- "shake-128s", "shake-128f", "shake-192s", "shake-192f", "shake-256s", "shake-256f"
69
- ].forEach(function (s) { INFER_ALG[O("id-slh-dsa-" + s)] = { name: _toUpperCase("SLH-DSA-" + s) }; });
67
+ _forEach(["Ed25519", "Ed448", "X25519", "X448"], function (n) { INFER_ALG[O(n)] = { name: n }; });
68
+ _forEach([["id-ml-dsa-44", "ML-DSA-44"], ["id-ml-dsa-65", "ML-DSA-65"], ["id-ml-dsa-87", "ML-DSA-87"],
69
+ ["id-ml-kem-512", "ML-KEM-512"], ["id-ml-kem-768", "ML-KEM-768"], ["id-ml-kem-1024", "ML-KEM-1024"]
70
+ ], function (r) { INFER_ALG[O(r[0])] = { name: r[1] }; });
71
+ _forEach(["sha2-128s", "sha2-128f", "sha2-192s", "sha2-192f", "sha2-256s", "sha2-256f",
72
+ "shake-128s", "shake-128f", "shake-192s", "shake-192f", "shake-256s", "shake-256f"
73
+ ], function (s) { INFER_ALG[O("id-slh-dsa-" + s)] = { name: _toUpperCase("SLH-DSA-" + s) }; });
70
74
 
71
75
  function _isCryptoKey(x) { return webcrypto.isCryptoKeyLike(x); }
72
76
  function _algName(a) { return typeof a === "string" ? a : (a && a.name); }
@@ -179,9 +179,9 @@ _sig("Ed448", { name: "Ed448" }, { name: "Ed448" }, "absent", false, true);
179
179
  _sig("id-ml-dsa-44", { name: "ML-DSA-44" }, { name: "ML-DSA-44" }, "absent", false, true);
180
180
  _sig("id-ml-dsa-65", { name: "ML-DSA-65" }, { name: "ML-DSA-65" }, "absent", false, true);
181
181
  _sig("id-ml-dsa-87", { name: "ML-DSA-87" }, { name: "ML-DSA-87" }, "absent", false, true);
182
- ["sha2-128s", "sha2-128f", "sha2-192s", "sha2-192f", "sha2-256s", "sha2-256f",
183
- "shake-128s", "shake-128f", "shake-192s", "shake-192f", "shake-256s", "shake-256f"
184
- ].forEach(function (set) {
182
+ intrinsic.forEach(["sha2-128s", "sha2-128f", "sha2-192s", "sha2-192f", "sha2-256s", "sha2-256f",
183
+ "shake-128s", "shake-128f", "shake-192s", "shake-192f", "shake-256s", "shake-256f"
184
+ ], function (set) {
185
185
  var wc = "SLH-DSA-" + set.toUpperCase();
186
186
  _sig("id-slh-dsa-" + set, { name: wc }, { name: wc }, "absent", false, true);
187
187
  });
@@ -304,7 +304,7 @@ function compositeKeyUsageCheck(cert) {
304
304
  }
305
305
 
306
306
  var STATEFUL_HBS_OIDS = intrinsic.create(null);
307
- ["id-alg-hss-lms-hashsig", "id-alg-xmss-hashsig", "id-alg-xmssmt-hashsig"].forEach(function (n) { STATEFUL_HBS_OIDS[oid.byName(n)] = true; });
307
+ intrinsic.forEach(["id-alg-hss-lms-hashsig", "id-alg-xmss-hashsig", "id-alg-xmssmt-hashsig"], function (n) { STATEFUL_HBS_OIDS[oid.byName(n)] = true; });
308
308
 
309
309
  /** @internal RFC 9802 sec. 6 states the rule twice, and the two differ: a certification authority's
310
310
  * certificate may assert keyCertSign, an end entity's may not. Both must assert at least one of the values
@@ -404,7 +404,7 @@ function statefulHbsKeyUsageCheck(cert, isCa) {
404
404
  }
405
405
 
406
406
  var ML_KEM_OIDS = intrinsic.create(null);
407
- ["id-ml-kem-512", "id-ml-kem-768", "id-ml-kem-1024"].forEach(function (n) { ML_KEM_OIDS[oid.byName(n)] = true; });
407
+ intrinsic.forEach(["id-ml-kem-512", "id-ml-kem-768", "id-ml-kem-1024"], function (n) { ML_KEM_OIDS[oid.byName(n)] = true; });
408
408
 
409
409
  function kemKeyUsageCheck(cert) {
410
410
  var ku;
package/lib/pki-build.js CHANGED
@@ -359,8 +359,8 @@ var ATV_TYPE = intrinsic.assign(intrinsic.create(null), {
359
359
  * pre-encoded value for one of them must be a member. An attribute with no published short
360
360
  * name has a syntax this toolkit does not claim to know, and its value stays opaque. */
361
361
  var DIRECTORY_STRING_TAGS = intrinsic.assign(intrinsic.create(null), {});
362
- [asn1.TAGS.TELETEX_STRING, asn1.TAGS.PRINTABLE_STRING, asn1.TAGS.UNIVERSAL_STRING,
363
- asn1.TAGS.UTF8_STRING, asn1.TAGS.BMP_STRING].forEach(function (t) { DIRECTORY_STRING_TAGS[t] = 1; });
362
+ intrinsic.forEach([asn1.TAGS.TELETEX_STRING, asn1.TAGS.PRINTABLE_STRING, asn1.TAGS.UNIVERSAL_STRING,
363
+ asn1.TAGS.UTF8_STRING, asn1.TAGS.BMP_STRING], function (t) { DIRECTORY_STRING_TAGS[t] = 1; });
364
364
 
365
365
  var KU_BIT = intrinsic.assign(intrinsic.create(null), {
366
366
  digitalSignature: 0, nonRepudiation: 1, contentCommitment: 1, keyEncipherment: 2,
@@ -396,12 +396,12 @@ var SDA_ATTR_KEYS = intrinsic.assign(intrinsic.create(null), { type: 1, values:
396
396
  * statement's set is refused rather than ignored: a misspelled field would otherwise be dropped and
397
397
  * the certificate would carry a statement the caller did not write. */
398
398
  var QC_INFO_KEYS = intrinsic.create(null);
399
- [["qcType", { types: 1 }], ["qcIdentMethod", { methods: 1 }],
399
+ intrinsic.forEach([["qcType", { types: 1 }], ["qcIdentMethod", { methods: 1 }],
400
400
  ["qcCClegislation", { countries: 1 }], ["qcQSCDlegislation", { countries: 1 }],
401
401
  ["qcRetentionPeriod", { years: 1 }], ["qcLimitValue", { currency: 1, amount: 1, exponent: 1 }],
402
402
  ["qcPDS", { locations: 1 }],
403
403
  ["qcsPkixQCSyntaxV1", { semanticsIdentifier: 1, nameRegistrationAuthorities: 1 }],
404
- ["qcsPkixQCSyntaxV2", { semanticsIdentifier: 1, nameRegistrationAuthorities: 1 }]].forEach(function (r) {
404
+ ["qcsPkixQCSyntaxV2", { semanticsIdentifier: 1, nameRegistrationAuthorities: 1 }]], function (r) {
405
405
  QC_INFO_KEYS[oid.byName(r[0])] = intrinsic.assign(intrinsic.create(null), r[1]);
406
406
  });
407
407
  var QC_PDS_LOCATION_KEYS = intrinsic.assign(intrinsic.create(null), { url: 1, language: 1 });
@@ -69,10 +69,10 @@ function mldsaDigestSuitable(mlName, md) {
69
69
  }
70
70
 
71
71
  var SLHDSA_BY_OID = intrinsic.create(null);
72
- [["sha2-128s", "sha256"], ["sha2-128f", "sha256"], ["sha2-192s", "sha512"], ["sha2-192f", "sha512"],
73
- ["sha2-256s", "sha512"], ["sha2-256f", "sha512"], ["shake-128s", "shake128"], ["shake-128f", "shake128"],
74
- ["shake-192s", "shake256"], ["shake-192f", "shake256"], ["shake-256s", "shake256"], ["shake-256f", "shake256"]
75
- ].forEach(function (r) { SLHDSA_BY_OID[O("id-slh-dsa-" + r[0])] = { wc: "SLH-DSA-" + r[0].toUpperCase(), digest: r[1] }; });
72
+ intrinsic.forEach([["sha2-128s", "sha256"], ["sha2-128f", "sha256"], ["sha2-192s", "sha512"], ["sha2-192f", "sha512"],
73
+ ["sha2-256s", "sha512"], ["sha2-256f", "sha512"], ["shake-128s", "shake128"], ["shake-128f", "shake128"],
74
+ ["shake-192s", "shake256"], ["shake-192f", "shake256"], ["shake-256s", "shake256"], ["shake-256f", "shake256"]
75
+ ], function (r) { SLHDSA_BY_OID[O("id-slh-dsa-" + r[0])] = { wc: "SLH-DSA-" + _toUpperCase(r[0]), digest: r[1] }; });
76
76
 
77
77
  function _algId(name, shape) { return shape === "null" ? b.sequence([b.oid(O(name)), b.nullValue()]) : b.sequence([b.oid(O(name))]); }
78
78
  function _pssAlgId(digestName) {
package/lib/webcrypto.js CHANGED
@@ -176,9 +176,9 @@ var ML_DSA_NODE = intrinsic.assign(intrinsic.create(null), { "ML-DSA-44": "ml-ds
176
176
  var ML_KEM_NODE = intrinsic.assign(intrinsic.create(null), { "ML-KEM-512": "ml-kem-512", "ML-KEM-768": "ml-kem-768", "ML-KEM-1024": "ml-kem-1024" });
177
177
 
178
178
  var SLH_DSA_NODE = intrinsic.create(null);
179
- ["sha2-128s", "sha2-128f", "sha2-192s", "sha2-192f", "sha2-256s", "sha2-256f",
180
- "shake-128s", "shake-128f", "shake-192s", "shake-192f", "shake-256s", "shake-256f"
181
- ].forEach(function (s) { SLH_DSA_NODE["SLH-DSA-" + _toUpperCase(s)] = "slh-dsa-" + s; });
179
+ _forEach(["sha2-128s", "sha2-128f", "sha2-192s", "sha2-192f", "sha2-256s", "sha2-256f",
180
+ "shake-128s", "shake-128f", "shake-192s", "shake-192f", "shake-256s", "shake-256f"
181
+ ], function (s) { SLH_DSA_NODE["SLH-DSA-" + _toUpperCase(s)] = "slh-dsa-" + s; });
182
182
 
183
183
  var SIGN_VERIFY_NAMES = intrinsic.create(null);
184
184
  ["RSASSA-PKCS1-V1_5", "RSA-PSS", "ECDSA", "ED25519", "ED448", "HMAC"]
@@ -868,7 +868,7 @@ function _nodeKey(fn, who) {
868
868
  }
869
869
 
870
870
  var ML_KEM_INNER = intrinsic.create(null);
871
- ["id-ml-kem-512", "id-ml-kem-768", "id-ml-kem-1024"].forEach(function (n) {
871
+ _forEach(["id-ml-kem-512", "id-ml-kem-768", "id-ml-kem-1024"], function (n) {
872
872
  var row = oid.kemParams(n);
873
873
  ML_KEM_INNER[oid.byName(n)] = { ek: row.ek, dk: row.dk };
874
874
  });
@@ -1010,7 +1010,7 @@ var IMPORT_KEY_TYPE = intrinsic.assign(intrinsic.create(null), {
1010
1010
  "ED25519": _typeSet(["ed25519"]), "ED448": _typeSet(["ed448"]),
1011
1011
  "X25519": _typeSet(["x25519"]), "X448": _typeSet(["x448"]),
1012
1012
  });
1013
- [ML_DSA_NODE, ML_KEM_NODE, SLH_DSA_NODE].forEach(function (m) {
1013
+ _forEach([ML_DSA_NODE, ML_KEM_NODE, SLH_DSA_NODE], function (m) {
1014
1014
  _forEach(_keys(m), function (webName) { IMPORT_KEY_TYPE[webName] = _typeSet([m[webName]]); });
1015
1015
  });
1016
1016
  function _algFromImport(name, alg, keyObject) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blamejs/pki",
3
- "version": "0.8.57",
3
+ "version": "0.8.59",
4
4
  "description": "Pure-JavaScript PKI toolkit that owns its stack — X.509, ASN.1/DER, CMS, PQC-first.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "blamejs contributors",
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:114b9f0f-7681-4cab-8c6a-fcdbf8fd64af",
5
+ "serialNumber": "urn:uuid:2b5749b0-053a-41de-947c-63a7a8df8028",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-10-07T02:26:14.514Z",
8
+ "timestamp": "2026-10-07T05:12:27.182Z",
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.8.57",
22
+ "bom-ref": "@blamejs/pki@0.8.59",
23
23
  "type": "application",
24
24
  "name": "pki",
25
- "version": "0.8.57",
25
+ "version": "0.8.59",
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.8.57",
29
+ "purl": "pkg:npm/%40blamejs/pki@0.8.59",
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.8.57",
57
+ "ref": "@blamejs/pki@0.8.59",
58
58
  "dependsOn": []
59
59
  }
60
60
  ]