@blamejs/pki 0.6.14 → 0.6.16
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 +27 -1
- package/lib/acme.js +59 -815
- package/lib/asn1-der.js +7 -245
- package/lib/attrcert-sign.js +12 -260
- package/lib/attrcert-verify.js +1 -7
- package/lib/byte-reader.js +0 -8
- package/lib/byte-writer.js +0 -11
- package/lib/cbor-det.js +0 -54
- package/lib/cmc-build.js +15 -357
- package/lib/cmc-verify.js +6 -239
- package/lib/cmp-build.js +41 -317
- package/lib/cmp-session.js +73 -760
- package/lib/cmp-verify.js +32 -488
- package/lib/cms-compress.js +3 -32
- package/lib/cms-decrypt.js +29 -294
- package/lib/cms-encrypt.js +14 -234
- package/lib/cms-sign.js +29 -324
- package/lib/cms-verify.js +9 -500
- package/lib/composite-kem.js +2 -102
- package/lib/composite-sig.js +1 -77
- package/lib/constants.js +0 -249
- package/lib/crl-sign.js +9 -237
- package/lib/crl-verify.js +1 -10
- package/lib/crmf-sign.js +19 -198
- package/lib/crmf-verify.js +1 -12
- package/lib/csr-sign.js +3 -34
- package/lib/csr-verify.js +1 -12
- package/lib/ct.js +28 -253
- package/lib/edwards-point.js +10 -44
- package/lib/est.js +28 -764
- package/lib/framework-error.js +4 -182
- package/lib/guard-all.js +1 -58
- package/lib/guard-async.js +1 -36
- package/lib/guard-bytes.js +6 -650
- package/lib/guard-compress.js +5 -102
- package/lib/guard-crypto.js +1 -40
- package/lib/guard-der.js +2 -93
- package/lib/guard-encoding.js +2 -60
- package/lib/guard-header.js +1 -36
- package/lib/guard-identifier.js +7 -531
- package/lib/guard-intrinsic.js +1 -150
- package/lib/guard-json.js +10 -73
- package/lib/guard-limits.js +1 -77
- package/lib/guard-list.js +1 -49
- package/lib/guard-name.js +3 -209
- package/lib/guard-parsed.js +7 -335
- package/lib/guard-range.js +1 -71
- package/lib/guard-secret.js +1 -102
- package/lib/guard-text.js +1 -64
- package/lib/guard-time.js +1 -97
- package/lib/hpke.js +3 -105
- package/lib/http-digest.js +14 -142
- package/lib/http-retry-after.js +1 -47
- package/lib/http-transport.js +21 -131
- package/lib/inspect.js +30 -284
- package/lib/ip-utils.js +6 -47
- package/lib/jose.js +7 -142
- package/lib/key.js +2 -67
- package/lib/lint.js +9 -194
- package/lib/merkle.js +1 -27
- package/lib/mime.js +9 -82
- package/lib/ocsp-request-verify.js +1 -14
- package/lib/ocsp-verify.js +1 -82
- package/lib/ocsp.js +11 -169
- package/lib/oid.js +5 -337
- package/lib/path-validate.js +103 -1492
- package/lib/pbes2.js +2 -89
- package/lib/pkcs12-build.js +31 -379
- package/lib/pki-build.js +64 -290
- package/lib/rc2.js +2 -18
- package/lib/rfc3339.js +4 -27
- package/lib/scep.js +140 -286
- package/lib/schema-all.js +0 -122
- package/lib/schema-attrcert.js +4 -146
- package/lib/schema-c509.js +153 -802
- package/lib/schema-cmc.js +5 -220
- package/lib/schema-cmp.js +2 -223
- package/lib/schema-cms.js +13 -427
- package/lib/schema-crl.js +5 -68
- package/lib/schema-crmf.js +6 -167
- package/lib/schema-csr.js +1 -54
- package/lib/schema-csrattrs.js +2 -87
- package/lib/schema-engine.js +0 -152
- package/lib/schema-ocsp.js +0 -117
- package/lib/schema-pkcs12.js +2 -93
- package/lib/schema-pkcs8.js +3 -35
- package/lib/schema-pkix.js +24 -655
- package/lib/schema-smime.js +0 -54
- package/lib/schema-tsp.js +3 -99
- package/lib/schema-x509.js +4 -63
- package/lib/shbs.js +11 -95
- package/lib/sign-scheme.js +2 -97
- package/lib/sigstore.js +9 -169
- package/lib/sleep.js +2 -8
- package/lib/smime.js +15 -408
- package/lib/tls-cert-compress.js +0 -62
- package/lib/trust.js +19 -185
- package/lib/tsp-sign.js +16 -270
- package/lib/validator-all.js +1 -30
- package/lib/validator-attcert.js +2 -46
- package/lib/validator-cose.js +2 -153
- package/lib/validator-keydesc.js +1 -37
- package/lib/validator-sig.js +1 -46
- package/lib/validator-tls.js +1 -88
- package/lib/validator-tpm.js +19 -122
- package/lib/verify-seam.js +1 -24
- package/lib/webauthn-mds.js +3 -400
- package/lib/webauthn.js +12 -833
- package/lib/webcrypto.js +5 -485
- package/lib/x509-sign.js +4 -108
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
package/lib/oid.js
CHANGED
|
@@ -40,110 +40,58 @@ var guard = require("./guard-all");
|
|
|
40
40
|
|
|
41
41
|
var OidError = frameworkError.OidError;
|
|
42
42
|
|
|
43
|
-
// (code, message) -> OidError, the factory shape the composed guards throw
|
|
44
|
-
// through so a malformed identifier keeps the oid/* typed verdict.
|
|
45
43
|
function _oidError(c, m) { return new OidError(c, m); }
|
|
46
44
|
|
|
47
|
-
// FAMILIES -- OIDs grouped by their shared base arc (the "similar starting
|
|
48
|
-
// variable" that defines a class). A member is `name: leaf`, where leaf is a
|
|
49
|
-
// trailing arc (number) or a short arc array for a multi-level leaf; the full
|
|
50
|
-
// arc is derived at load via base.concat(leaf). Declaring by family means no
|
|
51
|
-
// dotted-decimal OID literal appears in this source at all, and adding a
|
|
52
|
-
// member is one `name: leaf` line under its class, with no base to re-type.
|
|
53
45
|
var FAMILIES = {
|
|
54
|
-
// RFC 5280 attribute types.
|
|
55
46
|
attributeType: { base: [2, 5, 4], of: {
|
|
56
47
|
commonName: 3, surname: 4, serialNumber: 5, countryName: 6,
|
|
57
48
|
localityName: 7, stateOrProvinceName: 8, streetAddress: 9,
|
|
58
49
|
organizationName: 10, organizationalUnitName: 11, title: 12, givenName: 42,
|
|
59
|
-
// RFC 5755 sec. 4.4 attribute-certificate attribute types.
|
|
60
50
|
clearance: 55, role: 72 } },
|
|
61
51
|
|
|
62
|
-
// RFC 5280 certificate extensions.
|
|
63
52
|
certExtension: { base: [2, 5, 29], of: {
|
|
64
|
-
subjectDirectoryAttributes: 9,
|
|
53
|
+
subjectDirectoryAttributes: 9,
|
|
65
54
|
subjectKeyIdentifier: 14, keyUsage: 15, subjectAltName: 17, issuerAltName: 18,
|
|
66
55
|
basicConstraints: 19,
|
|
67
|
-
// CRL + CRL-entry extensions (RFC 5280 sec. 5.2, sec. 5.3)
|
|
68
56
|
cRLNumber: 20, reasonCode: 21, invalidityDate: 24, deltaCRLIndicator: 27,
|
|
69
57
|
issuingDistributionPoint: 28, certificateIssuer: 29,
|
|
70
58
|
nameConstraints: 30, cRLDistributionPoints: 31,
|
|
71
59
|
certificatePolicies: 32, policyMappings: 33, authorityKeyIdentifier: 35,
|
|
72
60
|
policyConstraints: 36, extKeyUsage: 37, freshestCRL: 46,
|
|
73
61
|
inhibitAnyPolicy: 54,
|
|
74
|
-
// The two special-OID leaves under extension arcs (RFC 5280 sec. 4.2.1.4 /
|
|
75
|
-
// sec. 4.2.1.12): the certificate-policies wildcard and the EKU wildcard.
|
|
76
62
|
anyPolicy: [32, 0], anyExtendedKeyUsage: [37, 0],
|
|
77
|
-
// RFC 5755 attribute-certificate extensions (sec. 4.3.2, sec. 4.3.6).
|
|
78
63
|
targetInformation: 55, noRevAvail: 56 } },
|
|
79
64
|
|
|
80
|
-
// PKIX private extensions on the id-pe arc (authorityInfoAccess et al, plus the
|
|
81
|
-
// RFC 5755 attribute-certificate id-pe extensions: ac-auditIdentity sec. 4.3.1,
|
|
82
|
-
// aaControls sec. 7.4, ac-proxying sec. 7.2).
|
|
83
65
|
pkixAccess: { base: [1, 3, 6, 1, 5, 5, 7, 1], of: {
|
|
84
66
|
authorityInfoAccess: 1, acAuditIdentity: 4, aaControls: 6, acProxying: 10,
|
|
85
67
|
acmeIdentifier: 31,
|
|
86
|
-
// id-pe-subjectInfoAccess (RFC 5280 sec. 4.2.2.2) -- the SIA extension companion to the AIA.
|
|
87
68
|
subjectInfoAccess: 11,
|
|
88
|
-
// id-pe-tlsfeature (RFC 7633) -- the TLS Feature (formerly "must-staple") extension.
|
|
89
69
|
tlsFeature: 24,
|
|
90
|
-
// id-pe-qcStatements (RFC 3739 sec. 3.2.6) -- the qualified-certificate-statements extension.
|
|
91
70
|
qcStatements: 3,
|
|
92
|
-
// RFC 3779 -- the IP-address and AS-number delegation extensions that carry a resource
|
|
93
|
-
// certificate's authority (RPKI). Each has an RFC 8360 "v2" twin with identical syntax and
|
|
94
|
-
// stricter path-validation semantics, so both are registered here.
|
|
95
71
|
ipAddrBlocks: 7, autonomousSysIds: 8, ipAddrBlocksV2: 28, autonomousSysIdsV2: 29 } },
|
|
96
72
|
|
|
97
|
-
// RFC 3739 sec. 3.2.6.1 id-qcs -- the PKIX QCStatement statementIds carrying SemanticsInformation.
|
|
98
73
|
pkixQcSyntax: { base: [1, 3, 6, 1, 5, 5, 7, 11], of: { qcsPkixQCSyntaxV1: 1, qcsPkixQCSyntaxV2: 2 } },
|
|
99
74
|
|
|
100
|
-
// ETSI EN 319 412-5 qualified-certificate statements (esi4-qcStatement-N) on the id-etsi-qcs arc.
|
|
101
75
|
etsiQcs: { base: [0, 4, 0, 1862, 1], of: {
|
|
102
76
|
qcCompliance: 1, qcLimitValue: 2, qcRetentionPeriod: 3, qcSSCD: 4, qcPDS: 5,
|
|
103
77
|
qcType: 6, qcCClegislation: 7, qcIdentMethod: 8, qcQSCDlegislation: 9 } },
|
|
104
78
|
|
|
105
|
-
// ETSI EN 319 412-5 QcType member OIDs (the certificate-purpose types) on the id-etsi-qct arc.
|
|
106
79
|
etsiQcType: { base: [0, 4, 0, 1862, 1, 6], of: { qctEsign: 1, qctEseal: 2, qctWeb: 3 } },
|
|
107
80
|
|
|
108
|
-
// [MS-WCCE] AD CS enrollment extensions on the id-microsoft-21 arc (szOID-CERTSRV / szOID-CERTIFICATE_TEMPLATE / szOID-APPLICATION_CERT_POLICIES).
|
|
109
81
|
msEnrollment: { base: [1, 3, 6, 1, 4, 1, 311, 21], of: {
|
|
110
82
|
msCaVersion: 1, msPreviousCertHash: 2, msCertificateTemplate: 7, msApplicationPolicies: 10 } },
|
|
111
83
|
|
|
112
|
-
// [MS-CRTD] legacy v1 enroll cert-type name on the id-microsoft-20 arc (szOID-ENROLL_CERTTYPE_EXTENSION).
|
|
113
84
|
msEnrollmentLegacy: { base: [1, 3, 6, 1, 4, 1, 311, 20], of: { msEnrollCertType: 2 } },
|
|
114
85
|
|
|
115
|
-
// id-aca -- RFC 5755 attribute-certificate attribute types on the id-pkix 10 arc:
|
|
116
|
-
// authenticationInfo sec. 4.4.1 .. group sec. 4.4.4, plus encAttrs sec. 7.1 (the encrypted-
|
|
117
|
-
// attribute wrapper, syntax ContentInfo). { id-aca 5 } is reserved.
|
|
118
86
|
idAca: { base: [1, 3, 6, 1, 5, 5, 7, 10], of: {
|
|
119
87
|
authenticationInfo: 1, accessIdentity: 2, chargingIdentity: 3, group: 4, encAttrs: 6 } },
|
|
120
88
|
|
|
121
|
-
// The legacy RFC 3281 id-at-clearance on the X.501 selected-attribute-types arc.
|
|
122
|
-
// RFC 5755 sec. 4.4.6 says implementations MUST NOT OUTPUT this form but SHOULD ACCEPT
|
|
123
|
-
// it for decoding, so it is registered as an alias of "clearance". The canonical
|
|
124
|
-
// name -> OID reverse stays the RFC 5755 attributeType-arc 2.5.4.55 (registered
|
|
125
|
-
// first under attributeType, so it wins the reverse mapping).
|
|
126
89
|
selectedAttrType: { base: [2, 5, 1, 5], of: { clearance: 55 } },
|
|
127
90
|
|
|
128
|
-
// PKIX Access Descriptor methods (id-ad, RFC 5280 sec. 4.2.2.1/sec. 4.2.2.2). id-ad-ocsp
|
|
129
|
-
// is the arc the OCSP responder OIDs hang under; id-ad-caIssuers names the AIA
|
|
130
|
-
// CA-issuers access method. The remaining id-ad methods (timeStamping RFC 3161, caRepository
|
|
131
|
-
// + rpkiManifest/signedObject/rpkiNotify RFC 6487/8182) complete the C509 Information Access
|
|
132
|
-
// registry (draft-ietf-cose-cbor-encoded-cert sec. 8.11); they carry the id-ad- prefix so the
|
|
133
|
-
// name->OID reverse stays unambiguous next to the id-kp "timeStamping" purpose (a distinct arc).
|
|
134
91
|
adAccess: { base: [1, 3, 6, 1, 5, 5, 7, 48], of: { ocsp: 1, caIssuers: 2,
|
|
135
92
|
"id-ad-timeStamping": 3, "id-ad-caRepository": 5, "id-ad-rpkiManifest": 10,
|
|
136
93
|
"id-ad-signedObject": 11, "id-ad-rpkiNotify": 13, "id-ad-cmc": 12 } },
|
|
137
94
|
|
|
138
|
-
// CMC control attributes -- id-cmc ::= {id-pkix 7} (RFC 5272 sec. 6, extended by RFC 6402
|
|
139
|
-
// sec. 2.2/2.8). The whole registry is declared, not just the controls used today: a control
|
|
140
|
-
// this side does not act on must still be RECOGNIZED to be reported by name, and a decoder that
|
|
141
|
-
// meets an unknown OID cannot tell "control this build ignores" from "attacker-supplied filler".
|
|
142
|
-
//
|
|
143
|
-
// The gaps are the specification's own: 12/13/14 (identityProof/popLinkRandom/popLinkWitness's
|
|
144
|
-
// superseded siblings are retained below where RFC 6402 kept them) and 20 are unassigned in
|
|
145
|
-
// RFC 5272 Appendix A. V2 forms exist because RFC 6402 replaced the originals to fix a hash
|
|
146
|
-
// agility gap. Both are registered, since a v1 message is still legal to receive.
|
|
147
95
|
idCmc: { base: [1, 3, 6, 1, 5, 5, 7, 7], of: {
|
|
148
96
|
"id-cmc-statusInfo": 1, "id-cmc-identification": 2, "id-cmc-identityProof": 3,
|
|
149
97
|
"id-cmc-dataReturn": 4, "id-cmc-transactionId": 5, "id-cmc-senderNonce": 6,
|
|
@@ -155,60 +103,21 @@ var FAMILIES = {
|
|
|
155
103
|
"id-cmc-confirmCertAcceptance": 24, "id-cmc-statusInfoV2": 25, "id-cmc-trustedAnchors": 26,
|
|
156
104
|
"id-cmc-authData": 27, "id-cmc-batchRequests": 28, "id-cmc-batchResponses": 29,
|
|
157
105
|
"id-cmc-publishCert": 30, "id-cmc-modCertTemplate": 31, "id-cmc-controlProcessed": 32,
|
|
158
|
-
// ---------------------------------------------------------------------
|
|
159
|
-
// 33 / 34: the specification assigns these two OIDs both ways, and no
|
|
160
|
-
// erratum resolves it. Counted across every place either document states an
|
|
161
|
-
// assignment, it is not an even split:
|
|
162
|
-
//
|
|
163
|
-
// identityProofV2 = 34, popLinkWitnessV2 = 33
|
|
164
|
-
// rfc5272.txt:1494 / :1504 the sec. 6 control summary table
|
|
165
|
-
// rfc5272.txt:1846 sec. 6.2.1 body
|
|
166
|
-
// rfc5272.txt:2037 sec. 6.3.1.1 body
|
|
167
|
-
// rfc5272.txt:4041 / :4049 RFC 5272's own ASN.1 module
|
|
168
|
-
// rfc6402.txt:1228 / :1245 RFC 6402 Appendix A.1 (1988 module)
|
|
169
|
-
//
|
|
170
|
-
// identityProofV2 = 33, popLinkWitnessV2 = 34
|
|
171
|
-
// rfc6402.txt:1938 / :1949 RFC 6402 Appendix A.2 (2008 module) alone
|
|
172
|
-
//
|
|
173
|
-
// The rows below therefore follow the base specification's normative body
|
|
174
|
-
// text and its module, which RFC 6402's own 1988 module agrees with. The
|
|
175
|
-
// 2008 module is the lone outlier and is treated as its typo.
|
|
176
|
-
//
|
|
177
|
-
// This binds what the toolkit EMITS, and it is load-bearing because the two
|
|
178
|
-
// controls cannot be told apart by SHAPE: both are SEQUENCE {
|
|
179
|
-
// AlgorithmIdentifier, AlgorithmIdentifier, OCTET STRING } (rfc6402.txt:1238,
|
|
180
|
-
// :1246), so the OID is the only discriminator. Emitting the A.2 reading
|
|
181
|
-
// would hand a peer built on RFC 5272 an Identity Proof it reads as a POP
|
|
182
|
-
// Link Witness. A CONSUMER must still not infer meaning from these names
|
|
183
|
-
// alone -- a peer built against A.2 means the other one, and nothing on the
|
|
184
|
-
// wire says which module it read.
|
|
185
106
|
"id-cmc-identityProofV2": 34, "id-cmc-popLinkWitnessV2": 33,
|
|
186
107
|
"id-cmc-raIdentityWitness": 35, "id-cmc-changeSubjectName": 36, "id-cmc-responseBody": 37,
|
|
187
108
|
} },
|
|
188
109
|
|
|
189
|
-
// CMC content types -- id-cct ::= {id-pkix 12} (RFC 5272 Appendix A). The eContentType a CMC
|
|
190
|
-
// message rides under inside its CMS SignedData wrapper. RFC 5272 Appendix B repeatedly writes
|
|
191
|
-
// "id-ct-PKIData"; that is erratum 4775 (Verified) and the correct prefix is id-cct-.
|
|
192
110
|
idCct: { base: [1, 3, 6, 1, 5, 5, 7, 12], of: {
|
|
193
111
|
"id-cct-PKIData": 2, "id-cct-PKIResponse": 3,
|
|
194
112
|
} },
|
|
195
113
|
|
|
196
|
-
// id-on -- RFC 5280 sec. 4.2.1.6 otherName type-ids the C509 sec. 8.13 registry gives their own
|
|
197
|
-
// negative ints: id-on-hardwareModuleName (RFC 4108), id-on-SmtpUTF8Mailbox (RFC 9598),
|
|
198
|
-
// id-on-MACAddress (I-D.ietf-lamps-macaddress-on) on the id-pkix 8 arc.
|
|
199
114
|
pkixOn: { base: [1, 3, 6, 1, 5, 5, 7, 8], of: { hardwareModuleName: 4, smtpUtf8Mailbox: 9, macAddress: 12 } },
|
|
200
115
|
|
|
201
|
-
// CA/Browser Forum certificate policies (draft-ietf-cose-cbor-encoded-cert sec. 8.9 ints 1-4) on the
|
|
202
|
-
// 2.23.140.1 arc: the id-cabf validation levels under .2, ev-guidelines under .1.
|
|
203
116
|
cabfPolicy: { base: [2, 23, 140, 1], of: {
|
|
204
117
|
"ev-guidelines": 1, "domain-validated": [2, 1], "organization-validated": [2, 2], "individual-validated": [2, 3] } },
|
|
205
118
|
|
|
206
|
-
// id-cp-ipAddr-asNumber (RFC 3779 / RFC 8360) on the id-pkix 14 arc: the RPKI resource-certificate
|
|
207
|
-
// policy OIDs (sec. 8.9 ints 7-8).
|
|
208
119
|
idCp: { base: [1, 3, 6, 1, 5, 5, 7, 14], of: { "id-cp-ipAddr-asNumber": 2, "id-cp-ipAddr-asNumber-v2": 3 } },
|
|
209
120
|
|
|
210
|
-
// GSMA SGP.22 Remote SIM Provisioning roles (sec. 8.9 ints 24-38) on the 2.23.146.1.2.1 id-rspRole arc.
|
|
211
|
-
// The -v2 roles are shallow leaves .{1..7}; the non-v2 roles descend into deeper sub-arcs (draft-20).
|
|
212
121
|
gsmaRspRole: { base: [2, 23, 146, 1, 2, 1], of: {
|
|
213
122
|
"id-rspRole-ci": 0, "id-rspRole-euicc-v2": 1, "id-rspRole-euicc": [0, 0, 0, 0, 0],
|
|
214
123
|
"id-rspRole-eum-v2": 2, "id-rspRole-eum": [0, 0, 0],
|
|
@@ -218,57 +127,29 @@ var FAMILIES = {
|
|
|
218
127
|
"id-rspRole-ds-tls-v2": 6, "id-rspRole-ds-tls": [0, 0, 2, 0],
|
|
219
128
|
"id-rspRole-ds-auth-v2": 7, "id-rspRole-ds-auth": [0, 0, 2, 1] } },
|
|
220
129
|
|
|
221
|
-
// id-qt policy qualifiers (RFC 5280 sec. 4.2.1.4) on the id-pkix 2 arc, which is the C509 sec. 8.10 registry.
|
|
222
130
|
pkixQt: { base: [1, 3, 6, 1, 5, 5, 7, 2], of: { cps: 1, unotice: 2 } },
|
|
223
131
|
|
|
224
|
-
// OCSP (RFC 6960) on the id-pkix-ocsp arc (= id-ad-ocsp). id-pkix-ocsp-basic is
|
|
225
|
-
// the ResponseBytes.responseType this build decodes; id-pkix-ocsp-nonce (sec. 4.4.1)
|
|
226
|
-
// names the nonce extension; the remaining members name the other OCSP extensions
|
|
227
|
-
// of RFC 6960 sec. 4.4 and RFC 9654 (CRL references, acceptable-response-types,
|
|
228
|
-
// archive-cutoff, service-locator, preferred-signature-algorithms, extended-revoke).
|
|
229
132
|
ocsp: { base: [1, 3, 6, 1, 5, 5, 7, 48, 1], of: {
|
|
230
133
|
ocspBasic: 1, ocspNonce: 2, ocspCrl: 3, ocspResponse: 4, ocspNoCheck: 5,
|
|
231
134
|
ocspArchiveCutoff: 6, ocspServiceLocator: 7, ocspPrefSigAlgs: 8, ocspExtendedRevoke: 9 } },
|
|
232
135
|
|
|
233
|
-
// CRMF (RFC 4211) registration controls (sec. 6) and registration info (sec. 7) on the
|
|
234
|
-
// id-pkip arc (id-pkix 5). id-regCtrl (id-pkip 1) names the control types a
|
|
235
|
-
// CertRequest carries; id-regInfo (id-pkip 2) names the registration-info types.
|
|
236
|
-
// The parser surfaces each control/info value raw, keyed by these names.
|
|
237
|
-
// altCertTemplate (7) and the two keySpec controls algId (11) / rsaKeyLen (12) are the RFC 9480
|
|
238
|
-
// sec. 2.16 additions; a CertReqTemplate response states its key requirements with the latter two.
|
|
239
136
|
regCtrl: { base: [1, 3, 6, 1, 5, 5, 7, 5, 1], of: {
|
|
240
137
|
regToken: 1, authenticator: 2, pkiPublicationInfo: 3, pkiArchiveOptions: 4, oldCertID: 5, protocolEncrKey: 6,
|
|
241
138
|
altCertTemplate: 7, algId: 11, rsaKeyLen: 12 } },
|
|
242
139
|
regInfo: { base: [1, 3, 6, 1, 5, 5, 7, 5, 2], of: { utf8Pairs: 1, certReq: 2 } },
|
|
243
140
|
|
|
244
|
-
// PKIX extended key purposes (id-kp, RFC 5280 sec. 4.2.1.12). timeStamping is required,
|
|
245
|
-
// critical, and sole on an RFC 3161 TSA signing certificate (sec. 2.3). The SSH
|
|
246
|
-
// (RFC 6187), CMC (RFC 6402), and Bundle Security (RFC 9174) purposes complete the C509
|
|
247
|
-
// Extended Key Usages registry (draft-ietf-cose-cbor-encoded-cert sec. 8.12).
|
|
248
141
|
pkixKp: { base: [1, 3, 6, 1, 5, 5, 7, 3], of: {
|
|
249
142
|
serverAuth: 1, clientAuth: 2, codeSigning: 3, emailProtection: 4, timeStamping: 8, ocspSigning: 9,
|
|
250
143
|
secureShellClient: 21, secureShellServer: 22, cmcCA: 27, cmcRA: 28, cmcArchive: 29, cmKGA: 32, bundleSecurity: 35 } },
|
|
251
144
|
|
|
252
|
-
// Kerberos PKINIT extended key purposes (id-pkinit, RFC 4556 sec. 3.2.3 / 3.2.4): the client
|
|
253
|
-
// and KDC authentication EKUs (C509 Extended Key Usages registry integers 10 / 11).
|
|
254
145
|
pkinitKp: { base: [1, 3, 6, 1, 5, 2, 3], of: { pkinitClientAuth: 4, pkinitKdc: 5 } },
|
|
255
146
|
|
|
256
|
-
// Wi-SUN FAN device extended key purpose (C509 Extended Key Usages registry integer 20).
|
|
257
147
|
wisun: { base: [1, 3, 6, 1, 4, 1, 45605], of: { fanDevice: 1 } },
|
|
258
148
|
|
|
259
|
-
// Google Certificate Transparency (RFC 6962) on the 1.3.6.1.4.1.11129.2.4 arc:
|
|
260
|
-
// the SCT-list X.509 extension (sec. 3.3), the precertificate poison (sec. 3.1), the
|
|
261
|
-
// precert-signing EKU (sec. 3.1, naming only), and the OCSP-delivered SCT list
|
|
262
|
-
// (sec. 3.3). The SCT payload itself is TLS presentation language, so it is parsed
|
|
263
|
-
// by lib/ct.js (pki.ct) and never routed through the DER schema engine.
|
|
264
149
|
ct: { base: [1, 3, 6, 1, 4, 1, 11129, 2, 4], of: {
|
|
265
150
|
signedCertificateTimestampList: 2, precertificatePoison: 3,
|
|
266
151
|
precertificateSigningCert: 4, ocspSignedCertificateTimestampList: 5 } },
|
|
267
152
|
|
|
268
|
-
// Fulcio (Sigstore) X.509 certificate-extension arc. `.1.1`-`.1.6` are the
|
|
269
|
-
// DEPRECATED members whose values are raw UTF-8 strings (no DER wrapping);
|
|
270
|
-
// `.1.7` is the OtherName SAN type; `.1.8` onward are DER-encoded ASN.1
|
|
271
|
-
// UTF8String -- the decode MUST honor the raw-vs-DER split by member.
|
|
272
153
|
fulcio: { base: [1, 3, 6, 1, 4, 1, 57264, 1], of: {
|
|
273
154
|
issuerLegacy: 1, githubWorkflowTrigger: 2, githubWorkflowSha: 3,
|
|
274
155
|
githubWorkflowName: 4, githubWorkflowRepository: 5, githubWorkflowRef: 6,
|
|
@@ -279,34 +160,25 @@ var FAMILIES = {
|
|
|
279
160
|
buildConfigURI: 18, buildConfigDigest: 19, buildTrigger: 20,
|
|
280
161
|
runInvocationURI: 21, sourceRepositoryVisibilityAtSigning: 22 } },
|
|
281
162
|
|
|
282
|
-
// PKCS#1 RSA public-key + RSASSA signature algorithms.
|
|
283
163
|
rsa: { base: [1, 2, 840, 113549, 1, 1], of: {
|
|
284
164
|
rsaEncryption: 1, rsaesOaep: 7, mgf1: 8, pSpecified: 9, rsassaPss: 10,
|
|
285
165
|
sha256WithRSAEncryption: 11,
|
|
286
166
|
sha384WithRSAEncryption: 12, sha512WithRSAEncryption: 13 } },
|
|
287
167
|
|
|
288
|
-
// PKCS#7 / CMS content types (RFC 5652 sec. 4, RFC 2315). id-signedData is the one
|
|
289
|
-
// this toolkit structurally decodes; the rest are recognized-and-deferred.
|
|
290
168
|
pkcs7: { base: [1, 2, 840, 113549, 1, 7], of: {
|
|
291
169
|
data: 1, signedData: 2, envelopedData: 3, signedAndEnvelopedData: 4,
|
|
292
170
|
digestedData: 5, encryptedData: 6 } },
|
|
293
171
|
|
|
294
|
-
// PKCS#9 attribute types, including the CMS signed-attribute OIDs (RFC 5652 sec. 11)
|
|
295
|
-
// and the PKCS#12 bag attributes friendlyName / localKeyId (RFC 7292 sec. 4.2).
|
|
296
172
|
pkcs9: { base: [1, 2, 840, 113549, 1, 9], of: {
|
|
297
173
|
emailAddress: 1, contentType: 3, messageDigest: 4, signingTime: 5,
|
|
298
174
|
countersignature: 6, challengePassword: 7, extensionRequest: 14,
|
|
299
175
|
smimeCapabilities: 15, friendlyName: 20, localKeyId: 21 } },
|
|
300
176
|
|
|
301
|
-
// PKCS#9 CertBag / CRLBag value discriminators (RFC 7292 sec. 4.2.3-sec. 4.2.4).
|
|
302
177
|
pkcs9CertTypes: { base: [1, 2, 840, 113549, 1, 9, 22], of: { x509Certificate: 1, sdsiCertificate: 2 } },
|
|
303
178
|
pkcs9CrlTypes: { base: [1, 2, 840, 113549, 1, 9, 23], of: { x509CRL: 1 } },
|
|
304
179
|
|
|
305
|
-
// PKCS#5 password-based schemes (RFC 8018) + the PBMAC1 MacData arm (RFC 9579).
|
|
306
180
|
pkcs5: { base: [1, 2, 840, 113549, 1, 5], of: { pbkdf2: 12, pbes2: 13, pbmac1: 14 } },
|
|
307
181
|
|
|
308
|
-
// CMP InfoTypeAndValue types -- id-it under id-pkix (RFC 9810 sec. 5.3.19; the
|
|
309
|
-
// PKIXCMP-2023 module assigns these leaves, 8/9 unassigned).
|
|
310
182
|
idIt: { base: [1, 3, 6, 1, 5, 5, 7, 4], of: {
|
|
311
183
|
caProtEncCert: 1, signKeyPairTypes: 2, encKeyPairTypes: 3, preferredSymmAlg: 4,
|
|
312
184
|
caKeyUpdateInfo: 5, currentCRL: 6, unsupportedOIDs: 7, keyPairParamReq: 10,
|
|
@@ -315,52 +187,32 @@ var FAMILIES = {
|
|
|
315
187
|
certReqTemplate: 19, rootCaCert: 20, certProfile: 21, crlStatusList: 22,
|
|
316
188
|
crls: 23, kemCiphertextInfo: 24 } },
|
|
317
189
|
|
|
318
|
-
// CMP message-protection MAC algorithms on the Entrust arc (RFC 9810
|
|
319
|
-
// sec. 5.1.3.1/.2/.4; RFC 9481 sec. 6.1.1).
|
|
320
190
|
entrustAlg: { base: [1, 2, 840, 113533, 7, 66], of: {
|
|
321
191
|
passwordBasedMac: 13, kemBasedMac: 16, dhBasedMac: 30 } },
|
|
322
192
|
|
|
323
|
-
// PKCS#12 bag types (RFC 7292 sec. 4.2, Appendix D).
|
|
324
193
|
pkcs12BagTypes: { base: [1, 2, 840, 113549, 1, 12, 10, 1], of: {
|
|
325
194
|
keyBag: 1, pkcs8ShroudedKeyBag: 2, certBag: 3, crlBag: 4, secretBag: 5, safeContentsBag: 6 } },
|
|
326
195
|
|
|
327
|
-
// PKCS#12 password-based encryption schemes (RFC 7292 Appendix C). These legacy
|
|
328
|
-
// PBE identifiers are still emitted by deployed exporters; they are recognized so
|
|
329
|
-
// a shrouded bag's algorithm resolves to a name, never decrypted here.
|
|
330
196
|
pkcs12Pbe: { base: [1, 2, 840, 113549, 1, 12, 1], of: {
|
|
331
197
|
pbeWithSHAAnd128BitRC4: 1, pbeWithSHAAnd40BitRC4: 2,
|
|
332
198
|
"pbeWithSHAAnd3-KeyTripleDES-CBC": 3, "pbeWithSHAAnd2-KeyTripleDES-CBC": 4,
|
|
333
199
|
"pbeWithSHAAnd128BitRC2-CBC": 5, "pbeWithSHAAnd40BitRC2-CBC": 6 } },
|
|
334
200
|
|
|
335
|
-
// RSADSI digest / HMAC algorithms (RFC 8018 sec. B.1) -- the PBKDF2 / PBMAC1 PRFs.
|
|
336
201
|
rsadsiDigest: { base: [1, 2, 840, 113549, 2], of: {
|
|
337
202
|
hmacWithSHA1: 7, hmacWithSHA224: 8, hmacWithSHA256: 9,
|
|
338
203
|
hmacWithSHA384: 10, hmacWithSHA512: 11 } },
|
|
339
204
|
|
|
340
|
-
// S/MIME content types on the PKCS#9 smime arc (RFC 5652, RFC 3161): id-ct.
|
|
341
|
-
// authData is RFC 5652 sec. 9 AuthenticatedData; authEnvelopedData is RFC 5083;
|
|
342
|
-
// compressedData is RFC 3274 CompressedData.
|
|
343
205
|
smimeCt: { base: [1, 2, 840, 113549, 1, 9, 16, 1], of: { authData: 2, tSTInfo: 4, compressedData: 9, encKeyWithID: 21, authEnvelopedData: 23 } },
|
|
344
206
|
|
|
345
|
-
// S/MIME other-recipient-info types (id-ori, RFC 5652 sec. 6.2.5). id-ori-kem
|
|
346
|
-
// carries a KEMRecipientInfo (RFC 9629) inside the ori [4] RecipientInfo arm.
|
|
347
207
|
smimeOri: { base: [1, 2, 840, 113549, 1, 9, 16, 13], of: { kem: 3 } },
|
|
348
208
|
|
|
349
|
-
// S/MIME algorithm identifiers (id-alg). The HKDF KDFs (RFC 8619) and the
|
|
350
|
-
// CEK-HKDF content-encryption wrapper (RFC 9709) a KEMRecipientInfo names, plus
|
|
351
|
-
// the RSA-KEM SPKI algorithm (RFC 9690). Parameters are absent for the HKDFs.
|
|
352
209
|
smimeAlg: { base: [1, 2, 840, 113549, 1, 9, 16, 3], of: {
|
|
353
210
|
"id-alg-zlibCompress": 8, "id-alg-PWRI-KEK": 9,
|
|
354
211
|
"id-rsa-kem": 14, "id-alg-hss-lms-hashsig": 17,
|
|
355
|
-
// RFC 8418 X25519/X448 key-agreement schemes (HKDF-based).
|
|
356
212
|
"dhSinglePass-stdDH-hkdf-sha256-scheme": 19, "dhSinglePass-stdDH-hkdf-sha384-scheme": 20,
|
|
357
213
|
"dhSinglePass-stdDH-hkdf-sha512-scheme": 21,
|
|
358
214
|
hkdfWithSha256: 28, hkdfWithSha384: 29, hkdfWithSha512: 30, cekHkdfSha256: 31 } },
|
|
359
215
|
|
|
360
|
-
// RFC 5753 ephemeral-static ECDH key-agreement schemes -- the keyEncryptionAlgorithm OID of a
|
|
361
|
-
// kari, whose PARAMETER is the KeyWrapAlgorithm (so these are not params-absent). The X9.63 KDF
|
|
362
|
-
// variants: stdDH (SECG arc 1.3.132.1.11) + cofactorDH (1.3.132.1.14) for SHA-224/256/384/512,
|
|
363
|
-
// and the SHA-1 KDF pair on the ANSI-X9.63 arc (the OpenSSL default).
|
|
364
216
|
secgStdDH: { base: [1, 3, 132, 1, 11], of: {
|
|
365
217
|
"dhSinglePass-stdDH-sha224kdf-scheme": 0, "dhSinglePass-stdDH-sha256kdf-scheme": 1,
|
|
366
218
|
"dhSinglePass-stdDH-sha384kdf-scheme": 2, "dhSinglePass-stdDH-sha512kdf-scheme": 3 } },
|
|
@@ -370,22 +222,10 @@ var FAMILIES = {
|
|
|
370
222
|
x963Schemes: { base: [1, 3, 133, 16, 840, 63, 0], of: {
|
|
371
223
|
"dhSinglePass-stdDH-sha1kdf-scheme": 2, "dhSinglePass-cofactorDH-sha1kdf-scheme": 3 } },
|
|
372
224
|
|
|
373
|
-
// PKIX algorithms arc -- the stateful hash-based signature algorithm
|
|
374
|
-
// identifiers (RFC 9802 sec. 4). HSS/LMS additionally has the SMIME
|
|
375
|
-
// id-alg-hss-lms-hashsig OID above (RFC 9708 / RFC 9802 share it).
|
|
376
225
|
pkixAlg: { base: [1, 3, 6, 1, 5, 5, 7, 6], of: {
|
|
377
|
-
// id-alg-noSignature (RFC 6402 sec. 2.4, {id-pkix id-alg(6) 2}): the CMC
|
|
378
|
-
// "signature" algorithm for a request whose signer has no key yet; the
|
|
379
|
-
// SignerInfo carries a MAC-based proof instead. Registered so a decoder can
|
|
380
|
-
// name it and refuse it deliberately.
|
|
381
226
|
"id-alg-noSignature": 2,
|
|
382
|
-
// RSASSA-PSS with SHAKE (RFC 8692): RSA signature algorithms on the PKIX arc.
|
|
383
|
-
// Registered so a consumer can name them -- e.g. the CMP keySpec RSA exclusion.
|
|
384
227
|
"id-RSASSA-PSS-SHAKE128": 30, "id-RSASSA-PSS-SHAKE256": 31,
|
|
385
228
|
"id-alg-xmss-hashsig": 34, "id-alg-xmssmt-hashsig": 35,
|
|
386
|
-
// Composite ML-DSA signature algorithms (draft-ietf-lamps-pq-composite-sigs
|
|
387
|
-
// sec. 6): a PQ ML-DSA paired with a traditional RSA / ECDSA / EdDSA so the
|
|
388
|
-
// certificate stays trustworthy if EITHER primitive is later broken.
|
|
389
229
|
"id-MLDSA44-RSA2048-PSS-SHA256": 37, "id-MLDSA44-RSA2048-PKCS15-SHA256": 38,
|
|
390
230
|
"id-MLDSA44-Ed25519-SHA512": 39, "id-MLDSA44-ECDSA-P256-SHA256": 40,
|
|
391
231
|
"id-MLDSA65-RSA3072-PSS-SHA512": 41, "id-MLDSA65-RSA3072-PKCS15-SHA512": 42,
|
|
@@ -395,9 +235,6 @@ var FAMILIES = {
|
|
|
395
235
|
"id-MLDSA87-ECDSA-P384-SHA512": 49, "id-MLDSA87-ECDSA-brainpoolP384r1-SHA512": 50,
|
|
396
236
|
"id-MLDSA87-Ed448-SHAKE256": 51, "id-MLDSA87-RSA3072-PSS-SHA512": 52,
|
|
397
237
|
"id-MLDSA87-RSA4096-PSS-SHA512": 53, "id-MLDSA87-ECDSA-P521-SHA512": 54,
|
|
398
|
-
// Composite ML-KEM key-establishment algorithms (draft-ietf-lamps-pq-composite-kem
|
|
399
|
-
// sec. 6): a PQ ML-KEM paired with a traditional RSA-OAEP / ECDH / X25519 / X448 so the
|
|
400
|
-
// established secret stays safe if EITHER primitive is later broken.
|
|
401
238
|
"id-MLKEM768-RSA2048-SHA3-256": 55, "id-MLKEM768-RSA3072-SHA3-256": 56,
|
|
402
239
|
"id-MLKEM768-RSA4096-SHA3-256": 57, "id-MLKEM768-X25519-SHA3-256": 58,
|
|
403
240
|
"id-MLKEM768-ECDH-P256-SHA3-256": 59, "id-MLKEM768-ECDH-P384-SHA3-256": 60,
|
|
@@ -405,82 +242,35 @@ var FAMILIES = {
|
|
|
405
242
|
"id-MLKEM1024-ECDH-P384-SHA3-256": 63, "id-MLKEM1024-ECDH-brainpoolP384r1-SHA3-256": 64,
|
|
406
243
|
"id-MLKEM1024-X448-SHA3-256": 65, "id-MLKEM1024-ECDH-P521-SHA3-256": 66 } },
|
|
407
244
|
|
|
408
|
-
// RSA-KEM key-transport algorithm (RFC 9690, obsoletes RFC 5990) on the ISO
|
|
409
|
-
// 18033-2 arc -- the kem OID an RSA KEMRecipientInfo carries (distinct from the
|
|
410
|
-
// id-rsa-kem SPKI algorithm above).
|
|
411
245
|
iso18033: { base: [1, 0, 18033, 2, 2], of: { "id-kem-rsa": 4 } },
|
|
412
246
|
|
|
413
|
-
// RFC 3370 HMAC-SHA-1 MAC algorithm (the AuthenticatedData macAlgorithm on the
|
|
414
|
-
// PKIX arc, distinct from the RSADSI hmacWithSHA1).
|
|
415
247
|
pkixHmac: { base: [1, 3, 6, 1, 5, 5, 8, 1], of: { "hmac-SHA1": 2 } },
|
|
416
248
|
|
|
417
|
-
// S/MIME authenticated attributes (id-aa, RFC 2634 / RFC 5035 / RFC 5816). The ESS
|
|
418
|
-
// signing-certificate attributes bind a CMS / TSP SignerInfo to its signing cert;
|
|
419
|
-
// signingCertificateV2 (ESSCertIDv2) carries a non-SHA-1 cert hash (RFC 5816 sec. 2.2.1).
|
|
420
|
-
// The RFC 2634 originals (receiptRequest .. contentReference) are name-only: they
|
|
421
|
-
// resolve to a name so an unsupported-attribute diagnostic is legible, not decoded.
|
|
422
|
-
// decryptKeyID / asymmDecryptKeyID name the out-of-band key-encryption key a
|
|
423
|
-
// /serverkeygen client references (RFC 4108 sec. 2.2.5 / RFC 7030 sec. 4.4.1);
|
|
424
|
-
// certificationRequestInfoTemplate / extensionReqTemplate are the RFC 9908
|
|
425
|
-
// CSR-attributes template carriers.
|
|
426
249
|
smimeAa: { base: [1, 2, 840, 113549, 1, 9, 16, 2], of: {
|
|
427
250
|
receiptRequest: 1, eSSSecurityLabel: 2, mlExpansionHistory: 3, contentHints: 4,
|
|
428
251
|
msgSigDigest: 5, contentIdentifier: 7, equivalentLabels: 9, contentReference: 10,
|
|
429
252
|
signingCertificate: 12, timeStampToken: 14, decryptKeyID: 37, signingCertificateV2: 47,
|
|
430
|
-
// id-aa-cmc-unsignedData (RFC 6402 sec. 2.7, {id-aa 34}): the CMC unsigned
|
|
431
|
-
// attribute that carries body parts too large to sit inside the signed
|
|
432
|
-
// PKIData. It is unsigned by design, so a consumer must treat its contents
|
|
433
|
-
// as untrusted data.
|
|
434
253
|
cmcUnsignedData: 34,
|
|
435
254
|
asymmDecryptKeyID: 54, certificationRequestInfoTemplate: 61, extensionReqTemplate: 62 } },
|
|
436
255
|
|
|
437
|
-
// ANSI X9.62 EC public key, named curve, and ECDSA signatures.
|
|
438
256
|
ansiX962: { base: [1, 2, 840, 10045], of: {
|
|
439
257
|
ecPublicKey: [2, 1], prime256v1: [3, 1, 7],
|
|
440
258
|
ecdsaWithSHA256: [4, 3, 2], ecdsaWithSHA384: [4, 3, 3], ecdsaWithSHA512: [4, 3, 4] } },
|
|
441
259
|
|
|
442
|
-
// SECG named curves.
|
|
443
260
|
secg: { base: [1, 3, 132, 0], of: { secp384r1: 34, secp521r1: 35 } },
|
|
444
261
|
|
|
445
|
-
// Brainpool named curves (RFC 5639).
|
|
446
262
|
brainpool: { base: [1, 3, 36, 3, 3, 2, 8, 1, 1], of: { brainpoolP256r1: 7, brainpoolP384r1: 11 } },
|
|
447
263
|
|
|
448
|
-
// Edwards / Montgomery curves (RFC 8410).
|
|
449
264
|
edwards: { base: [1, 3, 101], of: { X25519: 110, X448: 111, Ed25519: 112, Ed448: 113 } },
|
|
450
265
|
|
|
451
|
-
// OIW Secsig SHA-1 (1.3.14.3.2.26) -- the most common OCSP CertID hashAlgorithm;
|
|
452
|
-
// nistHash covers only SHA-256 and above.
|
|
453
|
-
// OIW Secsig arc (1.3.14.3.2). id-SHA1 (.26) plus every RSA identifier the OIW SIG assigned under the
|
|
454
|
-
// arc: md4WithRSA (.2), md5WithRSA (.3), md4WithRSAEncryption (.4), rsaSignature (.11, the ISO 9796 RSA
|
|
455
|
-
// scheme), mdc2WithRSASignature (.14), shaWithRSAEncryption (.15), rsaKeyTransport (.22), and the
|
|
456
|
-
// md2/md5/sha1-WithRSASignature set (.24/.25/.29) -- pre-PKCS#1 RSA algorithms still seen in old certs.
|
|
457
|
-
// This is the arc's complete RSA membership per the OIW SIG assignments. Registered so a consumer can
|
|
458
|
-
// name them -- e.g. the CMP keySpec RSA exclusion, which recognizes RSA wherever it is standardized.
|
|
459
|
-
// The arc is shared with DES, DSA, DH, and the hashes, so no prefix isolates RSA; each is named.
|
|
460
266
|
oiwSecsig: { base: [1, 3, 14, 3, 2], of: {
|
|
461
267
|
sha1: 26,
|
|
462
268
|
"md4WithRSA": 2, "md5WithRSA": 3, "md4WithRSAEncryption": 4, "rsaSignature": 11,
|
|
463
269
|
"mdc2WithRSASignature": 14, "shaWithRSAEncryption": 15, "rsaKeyTransport": 22,
|
|
464
270
|
"md2WithRSASignature": 24, "md5WithRSASignature": 25, "sha1WithRSASignature": 29 } },
|
|
465
271
|
|
|
466
|
-
// TeleTrusT (BSI) RSA signature arc (1.3.36.3.3.1) -- RSA signatures with SHA-1 and the RIPEMD family.
|
|
467
|
-
// The arc is RSA-dedicated, so a consumer can classify the whole family by its prefix; one member is
|
|
468
|
-
// registered here so that prefix can be derived from the registry rather than a dotted-decimal literal.
|
|
469
272
|
teletrustRsaSig: { base: [1, 3, 36, 3, 3, 1], of: { "rsaSignatureWithripemd160": 2 } },
|
|
470
273
|
|
|
471
|
-
// TeleTrusT (BSI) signatureScheme arc (1.3.36.3.4) -- the ISO/IEC 9796-2 RSA signatures giving message
|
|
472
|
-
// recovery (schemes 1/2/3: two deterministic, one randomized). ISO/IEC 9796-2 is titled "integer
|
|
473
|
-
// factorization based mechanisms", so EVERY scheme it defines is RSA and the standard has no non-RSA
|
|
474
|
-
// member; each node is registered so a consumer can name it -- e.g. the CMP keySpec RSA exclusion, which
|
|
475
|
-
// must recognize RSA wherever it is standardized. ISO/IEC 9796-2 assigns no algorithm OIDs of its own;
|
|
476
|
-
// this registrant tree is the de-facto registry. The .2 (deterministic) and .3 (randomized) sub-arcs are
|
|
477
|
-
// RSA-dedicated in full -- every descendant is RSA -- so a consumer prefix-matches each to catch a hash
|
|
478
|
-
// variant added later; the per-hash leaves are registered for readability. The `...Withrsa-even-exp`
|
|
479
|
-
// nodes (.2.1 / .3.1) are the even-public-exponent RSA variants the registrant marks "not used"; they are
|
|
480
|
-
// RSA (the registrant names them `sigS_ISO9796-2Withrsa_even-exp`), so the sub-arc prefix classifies them
|
|
481
|
-
// correctly, not wrongly. .1 is ISO/IEC 9796-1, also RSA, on the same arc. The PARENT node (.4) is generic
|
|
482
|
-
// "signatureScheme" and the sibling authentication arc (.5) is mixed (its .5.3 children are ECC), so
|
|
483
|
-
// neither is RSA-dedicated -- a consumer must not prefix-match the parent or .5.
|
|
484
274
|
teletrustSigScheme: { base: [1, 3, 36, 3, 4], of: {
|
|
485
275
|
"sigS-ISO9796-1": 1, "sigS-ISO9796-1-DFUE": [1, 1],
|
|
486
276
|
"sigS-ISO9796-2": 2, "sigS-ISO9796-2Withrsa-even-exp": [2, 1], "sigS-ISO9796-2Withrsa": [2, 2],
|
|
@@ -492,52 +282,25 @@ var FAMILIES = {
|
|
|
492
282
|
"sigS-ISO9796-2rndWithrsa-sha224": [3, 2, 3], "sigS-ISO9796-2rndWithrsa-sha256": [3, 2, 4],
|
|
493
283
|
"sigS-ISO9796-2rndWithrsa-sha384": [3, 2, 5], "sigS-ISO9796-2rndWithrsa-sha512": [3, 2, 6] } },
|
|
494
284
|
|
|
495
|
-
// X.509 directory encryptionAlgorithm arc (2.5.8.1). id-ea-rsa (.1) is the X.509 `rsa` public-key
|
|
496
|
-
// identifier, distinct from PKCS#1 rsaEncryption. Registered so a consumer can name it -- e.g. the
|
|
497
|
-
// CMP keySpec RSA exclusion, which must recognize RSA wherever it is standardized.
|
|
498
285
|
x509EncAlg: { base: [2, 5, 8, 1], of: { "rsa": 1 } },
|
|
499
286
|
|
|
500
|
-
// X.500 directory signatureAlgorithm arc (2.5.8.3). Its RSA members are sqMod-nWithRSA (.1, the
|
|
501
|
-
// ITU-T X.509 / ISO 9594-8 square-mod-n-with-RSA signature) and mdc2WithRSA (.100, MDC-2-with-RSA).
|
|
502
|
-
// Registered so the CMP keySpec RSA exclusion can name them; the arc is not RSA-dedicated, so each
|
|
503
|
-
// member is named individually rather than prefix-matched.
|
|
504
287
|
x509SigAlg: { base: [2, 5, 8, 3], of: { "sqMod-nWithRSA": 1, "mdc2WithRSA": 100 } },
|
|
505
288
|
|
|
506
|
-
// Chinese GM/T (SCA) SM algorithm arc (1.2.156.10197.1). Its one RSA member is sm3WithRSAEncryption
|
|
507
|
-
// (.504, a PKCS#1 v1.5 RSA signature over an SM3 digest); sm2 (.301), sm3 (.401), and SM2-with-SM3
|
|
508
|
-
// (.501) on the arc are not RSA. Registered so the CMP keySpec RSA exclusion can name it -- the arc is
|
|
509
|
-
// mixed, so the RSA member is named individually rather than prefix-matched.
|
|
510
289
|
smAlg: { base: [1, 2, 156, 10197, 1], of: { "sm3WithRSAEncryption": 504 } },
|
|
511
290
|
|
|
512
|
-
// BSI TR-03110 EAC Terminal Authentication RSA arc (0.4.0.127.0.7.2.2.2.1, id-TA-RSA). Every child is an
|
|
513
|
-
// RSA signature scheme -- PKCS#1 v1.5 or PSS over SHA-1/256/512 -- and the sibling id-TA-ECDSA arc
|
|
514
|
-
// (0.4.0.127.0.7.2.2.2.2) is EC, so this arc is RSA-dedicated. The members are registered so a consumer
|
|
515
|
-
// can derive the arc prefix from the registry rather than a dotted-decimal literal and classify the
|
|
516
|
-
// whole family, including a variant BSI adds later, by that prefix.
|
|
517
291
|
bsiTaRsa: { base: [0, 4, 0, 127, 0, 7, 2, 2, 2, 1], of: {
|
|
518
292
|
"id-TA-RSA-v1-5-SHA-1": 1, "id-TA-RSA-v1-5-SHA-256": 2, "id-TA-RSA-PSS-SHA-1": 3,
|
|
519
293
|
"id-TA-RSA-PSS-SHA-256": 4, "id-TA-RSA-v1-5-SHA-512": 5, "id-TA-RSA-PSS-SHA-512": 6 } },
|
|
520
294
|
|
|
521
|
-
// NIST AES content-encryption algorithms (arc 2.16.840.1.101.3.4.1) -- the
|
|
522
|
-
// modern PBES2 / CMS content ciphers a PKCS#12 or EnvelopedData names.
|
|
523
295
|
nistAes: { base: [2, 16, 840, 1, 101, 3, 4, 1], of: {
|
|
524
296
|
"aes128-CBC": 2, "aes128-wrap": 5, "aes128-GCM": 6, "aes128-CCM": 7,
|
|
525
297
|
"aes192-CBC": 22, "aes192-wrap": 25, "aes192-GCM": 26, "aes192-CCM": 27,
|
|
526
298
|
"aes256-CBC": 42, "aes256-wrap": 45, "aes256-GCM": 46, "aes256-CCM": 47 } },
|
|
527
299
|
|
|
528
|
-
// NIST hash functions (SHA-2, SHA-3, SHAKE).
|
|
529
300
|
nistHash: { base: [2, 16, 840, 1, 101, 3, 4, 2], of: {
|
|
530
301
|
sha256: 1, sha384: 2, sha512: 3, "sha3-256": 8, "sha3-512": 10, shake128: 11, shake256: 12 } },
|
|
531
302
|
|
|
532
|
-
// NIST signature algorithms -- FIPS 204 ML-DSA + FIPS 205 SLH-DSA share the
|
|
533
|
-
// signature arc 2.16.840.1.101.3.4.3. RFC 9909 sec. 3 assigns the 12 Pure SLH-DSA
|
|
534
|
-
// sets .20-.31 (SHA-2 .20-.25, SHAKE .26-.31) and the 12 pre-hash HashSLH-DSA
|
|
535
|
-
// sets .35-.46, each pairing a parameter set with its message-digest hash. The
|
|
536
|
-
// parameters MUST be absent for every one of them (enforced via paramsMustBeAbsent).
|
|
537
303
|
nistSig: { base: [2, 16, 840, 1, 101, 3, 4, 3], of: {
|
|
538
|
-
// RSASSA-PKCS1-v1_5 with SHA-3 (NIST CSOR): RSA signature algorithms on the NIST
|
|
539
|
-
// signature arc, alongside the ML-DSA / SLH-DSA sets. Registered so a consumer can
|
|
540
|
-
// name them -- e.g. the CMP keySpec check that must recognize RSA to exclude it.
|
|
541
304
|
"id-rsassa-pkcs1-v1_5-with-sha3-224": 13, "id-rsassa-pkcs1-v1_5-with-sha3-256": 14,
|
|
542
305
|
"id-rsassa-pkcs1-v1_5-with-sha3-384": 15, "id-rsassa-pkcs1-v1_5-with-sha3-512": 16,
|
|
543
306
|
"id-ml-dsa-44": 17, "id-ml-dsa-65": 18, "id-ml-dsa-87": 19,
|
|
@@ -554,45 +317,23 @@ var FAMILIES = {
|
|
|
554
317
|
"id-hash-slh-dsa-shake-192s-with-shake256": 43, "id-hash-slh-dsa-shake-192f-with-shake256": 44,
|
|
555
318
|
"id-hash-slh-dsa-shake-256s-with-shake256": 45, "id-hash-slh-dsa-shake-256f-with-shake256": 46 } },
|
|
556
319
|
|
|
557
|
-
// NIST KEM -- FIPS 203 ML-KEM (arc 2.16.840.1.101.3.4.4).
|
|
558
320
|
nistKem: { base: [2, 16, 840, 1, 101, 3, 4, 4], of: {
|
|
559
321
|
"id-ml-kem-512": 1, "id-ml-kem-768": 2, "id-ml-kem-1024": 3 } },
|
|
560
322
|
|
|
561
|
-
// Misc datatypes (RFC 4519 domainComponent).
|
|
562
323
|
datatype: { base: [0, 9, 2342, 19200300, 100, 1], of: { domainComponent: 25 } },
|
|
563
324
|
|
|
564
|
-
// FIDO Alliance generated-credential certificate extensions (arc
|
|
565
|
-
// 1.3.6.1.4.1.45724.1.1). id-fido-gen-ce-aaguid carries the authenticator's
|
|
566
|
-
// AAGUID -- a WebAuthn packed-attestation leaf-cert extension (WebAuthn L3 8.2.1)
|
|
567
|
-
// whose OCTET STRING value MUST equal the attestedCredentialData aaguid.
|
|
568
325
|
fidoGenCe: { base: [1, 3, 6, 1, 4, 1, 45724, 1, 1], of: { idFidoGenCeAaguid: 4 } },
|
|
569
326
|
|
|
570
|
-
// Android Keystore key-attestation extension (arc 1.3.6.1.4.1.11129.2.1). The
|
|
571
|
-
// keyDescription extension carries the hardware-backed KeyDescription SEQUENCE a
|
|
572
|
-
// WebAuthn android-key attestation leaf cert asserts (WebAuthn L3 8.4.1).
|
|
573
327
|
androidKeystore: { base: [1, 3, 6, 1, 4, 1, 11129, 2, 1], of: { keyDescription: 17 } },
|
|
574
328
|
|
|
575
|
-
// Apple anonymous-attestation extension (arc 1.2.840.113635.100.8). The value in
|
|
576
|
-
// a WebAuthn apple attestation leaf cert embeds the SHA-256 nonce over
|
|
577
|
-
// authenticatorData || clientDataHash (WebAuthn L3 8.8).
|
|
578
329
|
appleAttest: { base: [1, 2, 840, 113635, 100, 8], of: { appleAnonymousAttestation: 2 } },
|
|
579
330
|
|
|
580
|
-
// TCG (Trusted Computing Group) TPM identifiers on the 2.23.133 arc. tcgKp
|
|
581
|
-
// (id-tcg-kp) names the AIK-certificate extended key purpose a WebAuthn tpm
|
|
582
|
-
// attestation leaf cert MUST carry; tcgAt (id-tcg-at) names the tpmManufacturer /
|
|
583
|
-
// tpmModel / tpmVersion directory attributes its subjectAltName MUST carry
|
|
584
|
-
// (WebAuthn L3 8.3.1).
|
|
585
331
|
tcgKp: { base: [2, 23, 133, 8], of: { tcgKpAikCertificate: 3 } },
|
|
586
332
|
tcgAt: { base: [2, 23, 133, 2], of: { tpmManufacturer: 1, tpmModel: 2, tpmVersion: 3 } },
|
|
587
333
|
|
|
588
|
-
// SCEP (RFC 8894) transaction attributes on the VeriSign arc 2.16.840.1.113733.1.9
|
|
589
|
-
// (id-attributes). scep-prefixed because the CMC arc already registers senderNonce /
|
|
590
|
-
// transactionId under different OIDs (RFC 8894 sec. 3.2.1, Tables 1-2).
|
|
591
334
|
scepAttribute: { base: [2, 16, 840, 1, 113733, 1, 9], of: {
|
|
592
335
|
scepMessageType: 2, scepPkiStatus: 3, scepFailInfo: 4,
|
|
593
336
|
scepSenderNonce: 5, scepRecipientNonce: 6, scepTransactionId: 7 } },
|
|
594
|
-
// id-scep on the PKIX arc 1.3.6.1.5.5.7.24; failInfoText is the only leaf SCEP uses
|
|
595
|
-
// (RFC 8894 sec. 3.2.1.4).
|
|
596
337
|
scep: { base: [1, 3, 6, 1, 5, 5, 7, 24], of: { scepFailInfoText: 1 } },
|
|
597
338
|
};
|
|
598
339
|
|
|
@@ -601,44 +342,26 @@ var _byName = new Map();
|
|
|
601
342
|
|
|
602
343
|
function _index(dotted, name) {
|
|
603
344
|
_byOid.set(dotted, name);
|
|
604
|
-
// First registration of a name wins as the canonical reverse entry.
|
|
605
345
|
if (!_byName.has(name)) _byName.set(name, dotted);
|
|
606
346
|
}
|
|
607
347
|
|
|
608
|
-
// An arc is a non-negative integer. Large arcs (a 128-bit UUID-based arc
|
|
609
|
-
// exceeds 2^53) must be BigInt to survive without precision loss, so both
|
|
610
|
-
// a non-negative safe-integer Number and a non-negative BigInt are valid.
|
|
611
348
|
function _isArc(a) {
|
|
612
349
|
if (typeof a === "bigint") return a >= 0n;
|
|
613
350
|
return typeof a === "number" && Number.isSafeInteger(a) && a >= 0;
|
|
614
351
|
}
|
|
615
352
|
|
|
616
|
-
// Seed the registry family by family -- the built-in set is registered through
|
|
617
|
-
// the exact same primitive an operator uses (registerFamily), so there is one
|
|
618
|
-
// path from a declared family to indexed OIDs and no dotted literals anywhere.
|
|
619
353
|
Object.keys(FAMILIES).forEach(function (fam) {
|
|
620
354
|
registerFamily(FAMILIES[fam].base, FAMILIES[fam].of);
|
|
621
355
|
});
|
|
622
356
|
|
|
623
357
|
function _assertDotted(dotted, who) {
|
|
624
|
-
// SYNTAX only (canonical dotted form, no leading-zero arc that would round-trip
|
|
625
|
-
// to a DIFFERENT OID). For the LOOKUP entry points (name / has): a well-formed
|
|
626
|
-
// but non-encodable OID is simply not registered (a miss), not an error, so the
|
|
627
|
-
// X.660 arc bounds are waived (boundsCode null).
|
|
628
358
|
guard.identifier.assertCanonicalOid(dotted, _oidError, "oid/bad-input", who, null);
|
|
629
359
|
}
|
|
630
360
|
|
|
631
361
|
function _assertEncodable(dotted, who) {
|
|
632
|
-
// SYNTAX and the X.660 arc bounds -- for the paths that assert / convert a real
|
|
633
|
-
// encodable OID (toArcs / toDER / register), where an out-of-bounds arc is a
|
|
634
|
-
// hard reject (oid/bad-arc), so the string form agrees with the DER form.
|
|
635
362
|
guard.identifier.assertCanonicalOid(dotted, _oidError, "oid/bad-input", who, "oid/bad-arc");
|
|
636
363
|
}
|
|
637
364
|
|
|
638
|
-
// X.660 encodability: the root arc is 0..2 and, under roots 0 and 1, the
|
|
639
|
-
// second arc is 0..39 (the first two arcs pack into a single octet as
|
|
640
|
-
// 40*X+Y). An OID outside these bounds can never be DER-encoded, so a
|
|
641
|
-
// registration carrying one fails at config time, before anything tries to use it.
|
|
642
365
|
function _assertEncodableArcs(arcs, who) {
|
|
643
366
|
if (arcs.length < 2) {
|
|
644
367
|
throw new OidError("oid/bad-input", who + ": an OID must have at least 2 arcs");
|
|
@@ -674,16 +397,13 @@ function byName(n) {
|
|
|
674
397
|
return _byName.get(n);
|
|
675
398
|
}
|
|
676
399
|
|
|
677
|
-
// Does `s` look like a dotted-decimal OID -- one or more digit groups joined by single dots (at least two
|
|
678
|
-
// groups, no leading/trailing/doubled dot)? Distinguishes a numeric OID from a symbolic name so a caller may
|
|
679
|
-
// pass either. Decided by character scan (no regex); the arc-value bounds are the encoder's authority.
|
|
680
400
|
function isDottedDecimal(s) {
|
|
681
401
|
if (typeof s !== "string" || s.length === 0) return false;
|
|
682
402
|
var i, c, sawDot = false, atomEmpty = true;
|
|
683
403
|
for (i = 0; i < s.length; i += 1) {
|
|
684
404
|
c = s.charCodeAt(i);
|
|
685
|
-
if (c === 46) { if (atomEmpty) return false; sawDot = true; atomEmpty = true; }
|
|
686
|
-
else if (c >= 48 && c <= 57) { atomEmpty = false; }
|
|
405
|
+
if (c === 46) { if (atomEmpty) return false; sawDot = true; atomEmpty = true; }
|
|
406
|
+
else if (c >= 48 && c <= 57) { atomEmpty = false; }
|
|
687
407
|
else return false;
|
|
688
408
|
}
|
|
689
409
|
return sawDot && !atomEmpty;
|
|
@@ -711,9 +431,6 @@ function has(dotted) {
|
|
|
711
431
|
* pki.oid.register("1.3.6.1.4.1.99999.1", "acmeWidgetPolicy");
|
|
712
432
|
*/
|
|
713
433
|
function register(dotted, n) {
|
|
714
|
-
// _assertDotted now enforces the X.660 arc bounds on the string form too, so
|
|
715
|
-
// the separate arc-based check register used to run is redundant here (it is
|
|
716
|
-
// kept for registerFamily, which validates arcs it assembles, not a string).
|
|
717
434
|
_assertEncodable(dotted, "register");
|
|
718
435
|
if (typeof n !== "string" || n.length === 0) throw new OidError("oid/bad-input", "register: name must be a non-empty string");
|
|
719
436
|
_index(dotted, n);
|
|
@@ -771,9 +488,6 @@ function all() {
|
|
|
771
488
|
return out;
|
|
772
489
|
}
|
|
773
490
|
|
|
774
|
-
// toArcs / fromArcs -- dotted <-> numeric arc array. Arcs come back as
|
|
775
|
-
// Number where safe and BigInt where an arc exceeds 2^53 (rare, but a
|
|
776
|
-
// UUID-based OID arc can), so the round-trip never loses precision.
|
|
777
491
|
function toArcs(dotted) {
|
|
778
492
|
_assertEncodable(dotted, "toArcs");
|
|
779
493
|
return dotted.split(".").map(function (p) {
|
|
@@ -794,8 +508,6 @@ function fromArcs(arcs) {
|
|
|
794
508
|
}).join(".");
|
|
795
509
|
}
|
|
796
510
|
|
|
797
|
-
// DER convenience -- thin pass-throughs to the codec so callers reach for
|
|
798
|
-
// one namespace when they have a dotted string in hand.
|
|
799
511
|
function toDER(dotted) { _assertEncodable(dotted, "toDER"); return asn1.build.oid(dotted); }
|
|
800
512
|
function fromDER(input) {
|
|
801
513
|
var buf = guard.bytes.view(input, OidError, "oid/bad-input", "fromDER");
|
|
@@ -803,14 +515,6 @@ function fromDER(input) {
|
|
|
803
515
|
return asn1.read.oid(node);
|
|
804
516
|
}
|
|
805
517
|
|
|
806
|
-
// Algorithm identifiers whose `parameters` field MUST be absent -- no explicit
|
|
807
|
-
// NULL, no bytes. The FIPS 204 ML-DSA and FIPS 205 SLH-DSA signature families
|
|
808
|
-
// and the RFC 8410 Edwards / Montgomery curves each carry this MUST: RFC 9909 sec. 3
|
|
809
|
-
// (SLH-DSA in X.509), RFC 9814 sec. 4 (SLH-DSA in CMS), RFC 9881 sec. 2 (ML-DSA in X.509),
|
|
810
|
-
// RFC 8410 sec. 3 (Ed25519 / Ed448 / X25519 / X448). Built by NAME through the same
|
|
811
|
-
// registry every caller uses, so a typo fails closed at load rather than silently
|
|
812
|
-
// dropping a member. One set drives the single shared AlgorithmIdentifier reject
|
|
813
|
-
// (schema-pkix), so every format consumer inherits the rule with no per-format code.
|
|
814
518
|
var _PARAMS_ABSENT = new Set();
|
|
815
519
|
[
|
|
816
520
|
"id-ml-dsa-44", "id-ml-dsa-65", "id-ml-dsa-87",
|
|
@@ -818,7 +522,6 @@ var _PARAMS_ABSENT = new Set();
|
|
|
818
522
|
"id-slh-dsa-sha2-192f", "id-slh-dsa-sha2-256s", "id-slh-dsa-sha2-256f",
|
|
819
523
|
"id-slh-dsa-shake-128s", "id-slh-dsa-shake-128f", "id-slh-dsa-shake-192s",
|
|
820
524
|
"id-slh-dsa-shake-192f", "id-slh-dsa-shake-256s", "id-slh-dsa-shake-256f",
|
|
821
|
-
// Pre-hash HashSLH-DSA sets (RFC 9909 sec. 3) -- parameters MUST be absent too.
|
|
822
525
|
"id-hash-slh-dsa-sha2-128s-with-sha256", "id-hash-slh-dsa-sha2-128f-with-sha256",
|
|
823
526
|
"id-hash-slh-dsa-sha2-192s-with-sha512", "id-hash-slh-dsa-sha2-192f-with-sha512",
|
|
824
527
|
"id-hash-slh-dsa-sha2-256s-with-sha512", "id-hash-slh-dsa-sha2-256f-with-sha512",
|
|
@@ -826,16 +529,9 @@ var _PARAMS_ABSENT = new Set();
|
|
|
826
529
|
"id-hash-slh-dsa-shake-192s-with-shake256", "id-hash-slh-dsa-shake-192f-with-shake256",
|
|
827
530
|
"id-hash-slh-dsa-shake-256s-with-shake256", "id-hash-slh-dsa-shake-256f-with-shake256",
|
|
828
531
|
"Ed25519", "Ed448", "X25519", "X448",
|
|
829
|
-
// FIPS 203 ML-KEM (RFC 9935 sec. 3 certificates + RFC 9936 sec. 3 CMS: PARAMS ARE absent).
|
|
830
532
|
"id-ml-kem-512", "id-ml-kem-768", "id-ml-kem-1024",
|
|
831
|
-
// HKDF key-derivation identifiers (RFC 8619 sec. 2: when any of these appear
|
|
832
|
-
// within AlgorithmIdentifier, the parameters component SHALL be absent).
|
|
833
533
|
"hkdfWithSha256", "hkdfWithSha384", "hkdfWithSha512",
|
|
834
|
-
// Stateful hash-based signatures (RFC 9802 sec. 4 / RFC 9708): the parameters
|
|
835
|
-
// field MUST be absent for HSS/LMS, XMSS, and XMSS^MT public keys and signatures.
|
|
836
534
|
"id-alg-hss-lms-hashsig", "id-alg-xmss-hashsig", "id-alg-xmssmt-hashsig",
|
|
837
|
-
// Composite ML-DSA (draft-ietf-lamps-pq-composite-sigs sec. 5.3 + Figure 1:
|
|
838
|
-
// the parameters field MUST be absent for every composite AlgorithmIdentifier).
|
|
839
535
|
"id-MLDSA44-RSA2048-PSS-SHA256", "id-MLDSA44-RSA2048-PKCS15-SHA256",
|
|
840
536
|
"id-MLDSA44-Ed25519-SHA512", "id-MLDSA44-ECDSA-P256-SHA256",
|
|
841
537
|
"id-MLDSA65-RSA3072-PSS-SHA512", "id-MLDSA65-RSA3072-PKCS15-SHA512",
|
|
@@ -845,8 +541,6 @@ var _PARAMS_ABSENT = new Set();
|
|
|
845
541
|
"id-MLDSA87-ECDSA-P384-SHA512", "id-MLDSA87-ECDSA-brainpoolP384r1-SHA512",
|
|
846
542
|
"id-MLDSA87-Ed448-SHAKE256", "id-MLDSA87-RSA3072-PSS-SHA512",
|
|
847
543
|
"id-MLDSA87-RSA4096-PSS-SHA512", "id-MLDSA87-ECDSA-P521-SHA512",
|
|
848
|
-
// Composite ML-KEM (draft-ietf-lamps-pq-composite-kem sec. 5.3: the parameters
|
|
849
|
-
// field MUST be absent for every composite KEM AlgorithmIdentifier).
|
|
850
544
|
"id-MLKEM768-RSA2048-SHA3-256", "id-MLKEM768-RSA3072-SHA3-256",
|
|
851
545
|
"id-MLKEM768-RSA4096-SHA3-256", "id-MLKEM768-X25519-SHA3-256",
|
|
852
546
|
"id-MLKEM768-ECDH-P256-SHA3-256", "id-MLKEM768-ECDH-P384-SHA3-256",
|
|
@@ -855,9 +549,6 @@ var _PARAMS_ABSENT = new Set();
|
|
|
855
549
|
"id-MLKEM1024-X448-SHA3-256", "id-MLKEM1024-ECDH-P521-SHA3-256",
|
|
856
550
|
].forEach(function (nm) {
|
|
857
551
|
var d = byName(nm);
|
|
858
|
-
// A seed-list typo must fail at module load -- admitting undefined would
|
|
859
|
-
// make paramsMustBeAbsent(byName(sameTypo)) return TRUE for every other
|
|
860
|
-
// unregistered name (Set.has(undefined)), a fail-open guard.
|
|
861
552
|
if (typeof d !== "string") throw new OidError("oid/unknown-name", "paramsMustBeAbsent seed: " + JSON.stringify(nm) + " is not a registered name");
|
|
862
553
|
_PARAMS_ABSENT.add(d);
|
|
863
554
|
});
|
|
@@ -886,38 +577,15 @@ function paramsMustBeAbsent(dotted) {
|
|
|
886
577
|
return _PARAMS_ABSENT.has(dotted);
|
|
887
578
|
}
|
|
888
579
|
|
|
889
|
-
// ---- ML-KEM parameter sets (FIPS 203 Table 3) --------------------------------
|
|
890
|
-
//
|
|
891
|
-
// ONE row per parameter set, resolvable by dotted OID or by registered name, because the
|
|
892
|
-
// consumers hold different currencies: the CMS codec and the decrypt path key by OID, the
|
|
893
|
-
// linter keys by the SPKI algorithm's name. Before this table the same FIPS 203 constants
|
|
894
|
-
// lived in three modules -- schema-cms's ciphertext lengths, webcrypto's {ek, dk}, and
|
|
895
|
-
// lint's encapsulation-key lengths -- so a fourth consumer (a composite KEM, an HPKE row,
|
|
896
|
-
// HQC by analogy) meant a fourth copy, and the ek values were already duplicated verbatim
|
|
897
|
-
// in two of them. A parameter set is a property OF the algorithm identifier, so it lives
|
|
898
|
-
// beside the registry that resolves one rather than in whichever module needed it first.
|
|
899
|
-
//
|
|
900
|
-
// ek : encapsulation-key octets dk : decapsulation-key octets
|
|
901
|
-
// ct : ciphertext octets ss : shared-secret octets
|
|
902
|
-
// A null-prototype table: a plain object would answer kemParams("toString") with a function
|
|
903
|
-
// inherited from Object.prototype, so the documented fail-closed contract would hold for every
|
|
904
|
-
// input EXCEPT the handful every object already carries -- exactly the ones an untrusted
|
|
905
|
-
// identifier might be.
|
|
906
580
|
var KEM_PARAMS = Object.create(null);
|
|
907
581
|
[["id-ml-kem-512", 800, 1632, 768, 32],
|
|
908
582
|
["id-ml-kem-768", 1184, 2400, 1088, 32],
|
|
909
583
|
["id-ml-kem-1024", 1568, 3168, 1568, 32]].forEach(function (r) {
|
|
910
|
-
// FROZEN, because these rows are reachable from the public surface AND one of them now governs a
|
|
911
|
-
// security check: the engine reads .ct to enforce the FIPS 203 sec. 7.3 ciphertext length. A shared
|
|
912
|
-
// mutable row would let any code in the process rewrite that bound once, for every later call --
|
|
913
|
-
// a parameter set is a fact about the algorithm, not a setting an application may retune.
|
|
914
584
|
var row = Object.freeze({ ek: r[1], dk: r[2], ct: r[3], ss: r[4] });
|
|
915
|
-
KEM_PARAMS[byName(r[0])] = row;
|
|
916
|
-
KEM_PARAMS[r[0]] = row;
|
|
585
|
+
KEM_PARAMS[byName(r[0])] = row;
|
|
586
|
+
KEM_PARAMS[r[0]] = row;
|
|
917
587
|
});
|
|
918
588
|
Object.freeze(KEM_PARAMS);
|
|
919
|
-
// kemParams(oidOrName) -> the row, or undefined for anything that is not an ML-KEM
|
|
920
|
-
// parameter set. Undefined is the caller's signal to fail closed; it never guesses a size.
|
|
921
589
|
function kemParams(oidOrName) { return KEM_PARAMS[oidOrName]; }
|
|
922
590
|
|
|
923
591
|
module.exports = {
|