@blamejs/pki 0.5.7 → 0.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +418 -386
  2. package/MIGRATING.md +43 -0
  3. package/README.md +12 -12
  4. package/lib/acme.js +31 -31
  5. package/lib/asn1-der.js +10 -10
  6. package/lib/attrcert-sign.js +19 -19
  7. package/lib/byte-reader.js +6 -6
  8. package/lib/byte-writer.js +5 -5
  9. package/lib/cbor-det.js +27 -24
  10. package/lib/cmc-build.js +97 -92
  11. package/lib/cmc-verify.js +106 -30
  12. package/lib/cmp-build.js +25 -25
  13. package/lib/cmp-session.js +70 -70
  14. package/lib/cmp-verify.js +71 -57
  15. package/lib/cms-compress.js +7 -7
  16. package/lib/cms-decrypt.js +90 -72
  17. package/lib/cms-encrypt.js +32 -32
  18. package/lib/cms-sign.js +74 -55
  19. package/lib/cms-verify.js +97 -75
  20. package/lib/composite-sig.js +13 -13
  21. package/lib/constants.js +4 -4
  22. package/lib/crl-sign.js +22 -22
  23. package/lib/crl-verify.js +7 -6
  24. package/lib/crmf-sign.js +14 -14
  25. package/lib/csr-sign.js +8 -8
  26. package/lib/ct.js +37 -37
  27. package/lib/edwards-point.js +7 -7
  28. package/lib/est.js +98 -55
  29. package/lib/framework-error.js +5 -5
  30. package/lib/guard-all.js +5 -3
  31. package/lib/guard-async.js +4 -4
  32. package/lib/guard-bytes.js +79 -79
  33. package/lib/guard-compress.js +17 -17
  34. package/lib/guard-crypto.js +1 -1
  35. package/lib/guard-der.js +152 -0
  36. package/lib/guard-encoding.js +15 -15
  37. package/lib/guard-header.js +3 -3
  38. package/lib/guard-identifier.js +16 -16
  39. package/lib/guard-json.js +15 -15
  40. package/lib/guard-limits.js +7 -7
  41. package/lib/guard-name.js +81 -16
  42. package/lib/guard-parsed.js +80 -80
  43. package/lib/guard-range.js +19 -19
  44. package/lib/guard-secret.js +11 -10
  45. package/lib/guard-text.js +6 -6
  46. package/lib/guard-time.js +10 -10
  47. package/lib/hpke.js +18 -17
  48. package/lib/http-digest.js +35 -35
  49. package/lib/http-retry-after.js +13 -13
  50. package/lib/http-transport.js +20 -19
  51. package/lib/inspect.js +53 -53
  52. package/lib/ip-utils.js +2 -2
  53. package/lib/jose.js +13 -13
  54. package/lib/key.js +16 -16
  55. package/lib/lint.js +51 -51
  56. package/lib/merkle.js +51 -36
  57. package/lib/mime.js +18 -18
  58. package/lib/ocsp-verify.js +10 -10
  59. package/lib/ocsp.js +13 -13
  60. package/lib/oid.js +29 -29
  61. package/lib/path-validate.js +114 -113
  62. package/lib/pbes2.js +16 -16
  63. package/lib/pkcs12-build.js +53 -53
  64. package/lib/pki-build.js +48 -20
  65. package/lib/rc2.js +1 -1
  66. package/lib/rfc3339.js +5 -5
  67. package/lib/schema-all.js +31 -31
  68. package/lib/schema-attrcert.js +12 -12
  69. package/lib/schema-c509.js +149 -197
  70. package/lib/schema-cmc.js +58 -58
  71. package/lib/schema-cmp.js +43 -43
  72. package/lib/schema-cms.js +45 -45
  73. package/lib/schema-crl.js +7 -7
  74. package/lib/schema-crmf.js +28 -28
  75. package/lib/schema-csr.js +12 -12
  76. package/lib/schema-csrattrs.js +16 -16
  77. package/lib/schema-engine.js +18 -18
  78. package/lib/schema-ocsp.js +15 -15
  79. package/lib/schema-pkcs12.js +20 -20
  80. package/lib/schema-pkcs8.js +2 -2
  81. package/lib/schema-pkix.js +131 -126
  82. package/lib/schema-smime.js +19 -19
  83. package/lib/schema-tsp.js +12 -12
  84. package/lib/schema-x509.js +3 -3
  85. package/lib/shbs.js +18 -18
  86. package/lib/sign-scheme.js +13 -13
  87. package/lib/sigstore.js +10 -11
  88. package/lib/sleep.js +1 -1
  89. package/lib/smime.js +308 -96
  90. package/lib/tls-cert-compress.js +18 -18
  91. package/lib/trust.js +27 -27
  92. package/lib/tsp-sign.js +17 -17
  93. package/lib/validator-all.js +1 -1
  94. package/lib/validator-attcert.js +1 -1
  95. package/lib/validator-cose.js +43 -44
  96. package/lib/validator-keydesc.js +3 -3
  97. package/lib/validator-sig.js +13 -13
  98. package/lib/validator-tls.js +11 -11
  99. package/lib/validator-tpm.js +20 -19
  100. package/lib/webauthn-mds.js +66 -66
  101. package/lib/webauthn.js +33 -33
  102. package/lib/webcrypto.js +15 -15
  103. package/lib/x509-sign.js +13 -13
  104. package/package.json +3 -2
  105. package/sbom.cdx.json +6 -6
package/lib/schema-all.js CHANGED
@@ -11,13 +11,13 @@
11
11
  *
12
12
  * @intro
13
13
  * The schema family: a declarative ASN.1 structure-schema engine and the
14
- * per-format parsers built on it. Every format -- from X.509 certificates
15
- * and CRLs through CMS, OCSP, timestamps, and PKCS#12 stores; `all()`
16
- * enumerates the registered set -- is a member that COMPOSES the
14
+ * per-format parsers built on it. Every format, from X.509 certificates
15
+ * and CRLs through CMS, OCSP, timestamps, and PKCS#12 stores (`all()`
16
+ * enumerates the registered set), is a member that composes the
17
17
  * shared engine and the shared PKIX sub-schemas (AlgorithmIdentifier, Name,
18
- * Extension), so a structural rule -- bounds-checked positional reads,
18
+ * Extension), so a structural rule (bounds-checked positional reads,
19
19
  * optional / tagged field ordering, SET-OF uniqueness, fail-closed typed
20
- * errors -- is defined once in the engine and no format can reintroduce the
20
+ * errors) is defined once in the engine and no format can reintroduce the
21
21
  * class of bug it prevents.
22
22
  *
23
23
  * `parse` is the orchestrator: hand it DER (or PEM) and it detects which
@@ -45,8 +45,8 @@ var crmf = require("./schema-crmf");
45
45
  var cmp = require("./schema-cmp");
46
46
  var csrattrs = require("./schema-csrattrs");
47
47
  var attrcert = require("./schema-attrcert");
48
- // smime is a COMPANION decoder for CMS signed-attribute values, NOT a top-level
49
- // format -- it has no self-describing DER root (an ESS attribute value is a bare
48
+ // smime is a companion decoder for CMS signed-attribute values and not a top-level
49
+ // format: it has no self-describing DER root (an ESS attribute value is a bare
50
50
  // SEQUENCE) so it is deliberately absent from FORMATS / the detect-and-route
51
51
  // `parse`; it is reached only by explicit OID dispatch on a CMS attribute.
52
52
  var smime = require("./schema-smime");
@@ -84,7 +84,7 @@ var FORMATS = [
84
84
  // context [0] EXPLICIT content wrapper). Disjoint from the INTEGER-first pkcs8
85
85
  // and the tbs-SEQUENCE-first signed-envelope trio, so it detects unambiguously.
86
86
  // A non-SignedData content type routes here and gets a precise
87
- // cms/unsupported-content-type rather than schema/unknown-format.
87
+ // cms/unsupported-content-type instead of schema/unknown-format.
88
88
  name: "cms",
89
89
  module: cms,
90
90
  detect: cms.matches,
@@ -106,7 +106,7 @@ var FORMATS = [
106
106
  parse: function (input) { return tsp.parse(input); },
107
107
  },
108
108
  {
109
- // CertReqMessages ::= SEQUENCE SIZE(1..MAX) OF CertReqMsg (RFC 4211 sec. 3) -- a
109
+ // CertReqMessages ::= SEQUENCE SIZE(1..MAX) OF CertReqMsg (RFC 4211 sec. 3): a
110
110
  // SEQUENCE whose first CertReqMsg's CertRequest leads with a universal INTEGER
111
111
  // (certReqId) then a universal SEQUENCE (certTemplate). Leads with a SEQUENCE
112
112
  // like the signed-envelope trio and the ocsp-request, but the INTEGER-then-
@@ -120,13 +120,13 @@ var FORMATS = [
120
120
  },
121
121
  {
122
122
  // PKIMessage ::= SEQUENCE { header PKIHeader, body PKIBody [0..26],
123
- // protection [0]?, extraCerts [1]? } (RFC 9810 sec. 5.1) -- a SEQUENCE of 2-4
123
+ // protection [0]?, extraCerts [1]? } (RFC 9810 sec. 5.1): a SEQUENCE of 2-4
124
124
  // whose first child is a >=3-child SEQUENCE leading with a bare INTEGER
125
- // (pvno) and whose second child is context-constructed [0..26]. ORDER IS
126
- // LOAD-BEARING here: a 2-child PKIMessage whose body is ir [0] also
125
+ // (pvno) and whose second child is context-constructed [0..26]. Order is
126
+ // load-bearing here: a 2-child PKIMessage whose body is ir [0] also
127
127
  // satisfies the shallow ocsp-request probe below (k[0] SEQUENCE +
128
128
  // k[1] context-[0]), while no OCSPRequest satisfies this detector (its
129
- // tbsRequest never leads with a bare INTEGER) -- so cmp MUST sit ahead of
129
+ // tbsRequest never leads with a bare INTEGER), so cmp MUST sit ahead of
130
130
  // ocsp-request for the pair to dispatch deterministically.
131
131
  name: "cmp",
132
132
  module: cmp,
@@ -134,7 +134,7 @@ var FORMATS = [
134
134
  parse: function (input) { return cmp.parse(input); },
135
135
  },
136
136
  {
137
- // CsrAttrs ::= SEQUENCE SIZE (0..MAX) OF AttrOrOID (RFC 8951 sec. 3.5) -- a
137
+ // CsrAttrs ::= SEQUENCE SIZE (0..MAX) OF AttrOrOID (RFC 8951 sec. 3.5): a
138
138
  // SEQUENCE whose every child is a bare universal OID or an Attribute (a
139
139
  // universal SEQUENCE of exactly 2: OID + SET). A 1-2-element all-Attribute
140
140
  // CsrAttrs satisfies the permissive ocsp-request probe below (SEQUENCE +
@@ -149,10 +149,10 @@ var FORMATS = [
149
149
  },
150
150
  {
151
151
  // OCSPRequest ::= SEQUENCE { tbsRequest SEQUENCE, optionalSignature [0] EXPLICIT
152
- // OPTIONAL } -- a SEQUENCE of 1-2 whose first child is the tbsRequest SEQUENCE.
152
+ // OPTIONAL }: a SEQUENCE of 1-2 whose first child is the tbsRequest SEQUENCE.
153
153
  // Leads with a SEQUENCE like the signed-envelope trio, but is excluded by arity
154
- // (the trio is EXACTLY 3 children; an OCSPRequest is 1-2). Checked AFTER tsp,
155
- // whose detector is a strict refinement (RFC 6960 sec. 4.1.1), and AFTER cmp,
154
+ // (the trio is exactly 3 children; an OCSPRequest is 1-2). Checked after tsp,
155
+ // whose detector is a strict refinement (RFC 6960 sec. 4.1.1), and after cmp,
156
156
  // whose 2-child ir-body shape this probe would otherwise shadow.
157
157
  name: "ocsp-request",
158
158
  module: ocsp,
@@ -161,7 +161,7 @@ var FORMATS = [
161
161
  },
162
162
  {
163
163
  // OCSPResponse ::= SEQUENCE { responseStatus ENUMERATED, responseBytes [0]
164
- // EXPLICIT OPTIONAL } -- the only registered root that leads with an ENUMERATED
164
+ // EXPLICIT OPTIONAL }: the only registered root that leads with an ENUMERATED
165
165
  // child, so it is disjoint from every other format (RFC 6960 sec. 4.2.1).
166
166
  name: "ocsp-response",
167
167
  module: ocsp,
@@ -170,8 +170,8 @@ var FORMATS = [
170
170
  },
171
171
  {
172
172
  // PKCS#12 PFX ::= SEQUENCE { version INTEGER, authSafe ContentInfo, macData
173
- // OPTIONAL } -- INTEGER-first like pkcs8, so the discriminators are deeper:
174
- // children[1] is a ContentInfo (SEQUENCE of exactly 2: OID + [0] constructed --
173
+ // OPTIONAL }: INTEGER-first like pkcs8, so the discriminators are deeper.
174
+ // children[1] is a ContentInfo (SEQUENCE of exactly 2: OID + [0] constructed,
175
175
  // a shape a PrivateKeyInfo's AlgorithmIdentifier never presents) and
176
176
  // children[2] is a MacData SEQUENCE or absent (pkcs8 requires an OCTET STRING
177
177
  // there). Shape-disjoint from pkcs8, and registered ahead of it as the more
@@ -183,11 +183,11 @@ var FORMATS = [
183
183
  parse: function (input) { return pkcs12.parse(input); },
184
184
  },
185
185
  {
186
- // PKCS#8 PrivateKeyInfo / OneAsymmetricKey -- SEQUENCE whose first child is an
186
+ // PKCS#8 PrivateKeyInfo / OneAsymmetricKey: a SEQUENCE whose first child is an
187
187
  // INTEGER (version) and third an OCTET STRING (privateKey); disjoint from the
188
- // signed-envelope trio. (EncryptedPrivateKeyInfo is deliberately NOT
189
- // auto-routed: its SEQUENCE{SEQUENCE, OCTET STRING} shape is ambiguous -- a
190
- // PKCS#1 DigestInfo is identical -- so structural detection cannot classify it
188
+ // signed-envelope trio. (EncryptedPrivateKeyInfo is deliberately not
189
+ // auto-routed: its SEQUENCE{SEQUENCE, OCTET STRING} shape is ambiguous, since a
190
+ // PKCS#1 DigestInfo is identical, so structural detection cannot classify it
191
191
  // without a validated encryption-algorithm discriminator, which arrives with
192
192
  // the PBES layer. It is reached explicitly via pki.schema.pkcs8.parseEncrypted.)
193
193
  name: "pkcs8",
@@ -197,8 +197,8 @@ var FORMATS = [
197
197
  },
198
198
  {
199
199
  // CertificationRequest ::= SEQUENCE { certificationRequestInfo,
200
- // signatureAlgorithm, signature } -- the same outer 3-element shape,
201
- // distinguished by a CertificationRequestInfo of EXACTLY four children
200
+ // signatureAlgorithm, signature }: the same outer 3-element shape,
201
+ // distinguished by a CertificationRequestInfo of exactly four children
202
202
  // ending in the IMPLICIT [0] attributes element. Checked first because that
203
203
  // detector is the most specific and mutually exclusive with the others.
204
204
  name: "csr",
@@ -237,7 +237,7 @@ var FORMATS = [
237
237
  },
238
238
  {
239
239
  // CertificateList ::= SEQUENCE { tbsCertList, signatureAlgorithm,
240
- // signatureValue } -- the same outer shape as a certificate, distinguished
240
+ // signatureValue }: the same outer shape as a certificate, distinguished
241
241
  // by its tbsCertList (a bare Time at the certificate's Validity position).
242
242
  name: "crl",
243
243
  module: crl,
@@ -247,8 +247,8 @@ var FORMATS = [
247
247
  {
248
248
  name: "x509",
249
249
  module: x509,
250
- // Certificate -- identified by a Validity (SEQUENCE of two Times) inside the
251
- // tbs, so a CSR / other 3-element signed envelope is NOT misclassified as a
250
+ // Certificate, identified by a Validity (SEQUENCE of two Times) inside the
251
+ // tbs, so a CSR or other 3-element signed envelope is not misclassified as a
252
252
  // certificate (it falls through to schema/unknown-format).
253
253
  detect: x509.matches,
254
254
  parse: function (input) { return x509.parse(input); },
@@ -312,11 +312,11 @@ function parse(input) {
312
312
  * @related pki.schema.parse, pki.schema.all
313
313
  *
314
314
  * Detect which registered PKI format `input` (a DER `Buffer` or PEM string)
315
- * encodes and return its name -- one of `pki.schema.all()` -- WITHOUT parsing it,
315
+ * encodes and return its name, one of `pki.schema.all()`, without parsing it,
316
316
  * or `null` when the decoded bytes match no registered format. This is the
317
317
  * detection half of `pki.schema.parse`, running the same authoritative `FORMATS`
318
318
  * ordering, exposed for a caller (e.g. `pki.inspect.any`) that needs the format
319
- * name rather than the parsed result. Input that does not decode as DER throws the
319
+ * name instead of the parsed result. Input that does not decode as DER throws the
320
320
  * same coercion / decode error `parse` throws.
321
321
  *
322
322
  * @example
@@ -29,7 +29,7 @@
29
29
  *
30
30
  * @card
31
31
  * Parse DER / PEM RFC 5755 attribute certificates into holder, issuer,
32
- * validity, attributes, and extensions -- validated GeneralNames, raw verifier
32
+ * validity, attributes, and extensions: validated GeneralNames, raw verifier
33
33
  * inputs, legacy v1 recognize-and-defer, fail-closed.
34
34
  */
35
35
 
@@ -51,7 +51,7 @@ var TAGS = asn1.TAGS;
51
51
  var ALGORITHM_IDENTIFIER = pkix.algorithmIdentifier(NS);
52
52
  var EXTENSIONS = pkix.extensions(NS);
53
53
 
54
- // AttCertVersion ::= INTEGER { v2(1) } -- a bare, mandatory INTEGER (not the x509
54
+ // AttCertVersion ::= INTEGER { v2(1) }, a bare mandatory INTEGER (not the x509
55
55
  // [0] EXPLICIT DEFAULT shape). The only legal value is v2, surfaced as 2.
56
56
  var VERSION = pkix.versionReader(NS, { "1": 2 });
57
57
 
@@ -62,7 +62,7 @@ var VERSION = pkix.versionReader(NS, { "1": 2 });
62
62
  var GENERALIZED_TIME = pkix.generalizedTime(NS, { code: "attrcert/bad-time", message: "AttCertValidityPeriod times must be GeneralizedTime (RFC 5755 sec. 4.2.6)" });
63
63
 
64
64
  // digestedObjectType ::= ENUMERATED { publicKey(0), publicKeyCert(1),
65
- // otherObjectTypes(2) } (RFC 5755 sec. 4.1) -- an undefined value is rejected; a
65
+ // otherObjectTypes(2) } (RFC 5755 sec. 4.1). An undefined value is rejected; a
66
66
  // non-ENUMERATED tag fails at the codec (asn1/*).
67
67
  // objectDigestInfo digested-object-type names -- single source pki.C.NAMES.OBJECT_DIGEST_TYPE.
68
68
  var ODT_NAMES = constants.NAMES.OBJECT_DIGEST_TYPE;
@@ -74,7 +74,7 @@ var DIGESTED_OBJECT_TYPE = schema.decode(function (n, ctx) {
74
74
  }
75
75
  // RFC 5755 sec. 7.3 -- a conformant AC MUST NOT use otherObjectTypes(2); the digested
76
76
  // object is limited to a public key or a public-key certificate, so reject it
77
- // fail-closed rather than parse a digest whose object type is unidentifiable.
77
+ // fail-closed instead of parsing a digest whose object type is unidentifiable.
78
78
  if (k === "2") {
79
79
  throw ctx.E("attrcert/bad-digested-object-type", "otherObjectTypes(2) MUST NOT be used (RFC 5755 sec. 7.3)");
80
80
  }
@@ -164,8 +164,8 @@ var HOLDER = schema.seq([
164
164
  // OPTIONAL } (RFC 5755 sec. 4.1). Reached via the AttCertIssuer CHOICE on a context [0]
165
165
  // node, so the shape is "constructed". The build enforces the sec. 4.2.3 issuer
166
166
  // profile MUSTs: every field is syntactically OPTIONAL, but a conformant AC's
167
- // issuerName is present with one and only one GeneralName -- a non-empty
168
- // directoryName -- and baseCertificateID / objectDigestInfo are absent.
167
+ // issuerName is present with one and only one GeneralName (a non-empty
168
+ // directoryName) and baseCertificateID / objectDigestInfo are absent.
169
169
  var V2_FORM = schema.seq([
170
170
  schema.optional("issuerName", pkix.generalNames(NS, { code: "attrcert/bad-issuer-name" }), { whenUniversal: [TAGS.SEQUENCE] }),
171
171
  schema.trailing([
@@ -201,8 +201,8 @@ var V2_FORM = schema.seq([
201
201
 
202
202
  // AttCertIssuer ::= CHOICE { v1Form GeneralNames, v2Form [0] IMPLICIT V2Form } (RFC
203
203
  // 5755 sec. 4.1). A universal SEQUENCE is the (obsolete but structurally recognizable)
204
- // v1Form, which a conformant AC MUST NOT use (sec. 4.2.3) -- the arm is recognized and
205
- // rejected with a precise verdict rather than mis-dispatched; a context [0] is v2Form.
204
+ // v1Form, which a conformant AC MUST NOT use (sec. 4.2.3). The arm is recognized and
205
+ // rejected with a precise verdict instead of mis-dispatched; a context [0] is v2Form.
206
206
  var ATT_CERT_ISSUER = schema.choice([
207
207
  { when: { tagClass: "universal", tagNumber: TAGS.SEQUENCE },
208
208
  schema: schema.decode(function (n, ctx) {
@@ -223,7 +223,7 @@ var VALIDITY = schema.seq([
223
223
  build: function (m) { return { notBeforeTime: m.fields.notBeforeTime.value, notAfterTime: m.fields.notAfterTime.value }; },
224
224
  });
225
225
 
226
- // attributes ::= SEQUENCE OF Attribute (RFC 5755 sec. 4.2.7) -- MUST be non-empty and
226
+ // attributes ::= SEQUENCE OF Attribute (RFC 5755 sec. 4.2.7), which MUST be non-empty and
227
227
  // each AttributeType OID unique. Order-preserving (SEQUENCE OF, not SET OF).
228
228
  var ATTRIBUTES = schema.seqOf(pkix.attribute(NS), {
229
229
  assert: "sequence", min: 1, code: "attrcert/bad-attributes", what: "attributes",
@@ -250,7 +250,7 @@ var ACINFO = schema.seq([
250
250
  ], { assert: "sequence", code: "attrcert/bad-acinfo", what: "AttributeCertificateInfo" });
251
251
 
252
252
  // AttributeCertificate ::= SEQUENCE { acinfo, signatureAlgorithm, signatureValue
253
- // BIT STRING } -- the shared SIGNED envelope (RFC 5755 sec. 4.1). The AC-specific
253
+ // BIT STRING }, the shared SIGNED envelope (RFC 5755 sec. 4.1). The AC-specific
254
254
  // invariants (sec. 4.2.4 sig-alg agreement, sec. 4.2.5 positive-and-<=20-octet serialNumber)
255
255
  // run in the build; the envelope owns the SEQUENCE-of-3 shape + signature extraction.
256
256
  var ATTRIBUTE_CERTIFICATE = pkix.signedEnvelope(NS, ACINFO, {
@@ -265,7 +265,7 @@ var ATTRIBUTE_CERTIFICATE = pkix.signedEnvelope(NS, ACINFO, {
265
265
 
266
266
  // RFC 5755 sec. 4.2.5 -- serialNumber MUST be a positive INTEGER of at most 20 content
267
267
  // octets. Positive excludes both a negative (DER sign bit set) and zero (a minimal
268
- // INTEGER 0 is a single 0x00 octet -- the codec already rejected any non-minimal
268
+ // INTEGER 0 is a single 0x00 octet, and the codec already rejected any non-minimal
269
269
  // zero). Surface it lossless (BigInt) + as hex.
270
270
  var serialNode = acinfo.fields.serialNumber.node;
271
271
  var sc = serialNode.content;
@@ -386,7 +386,7 @@ function parseV1(input) {
386
386
  * @related pki.schema.attrcert.parse
387
387
  *
388
388
  * Extract the DER bytes from a PEM block (default label
389
- * `ATTRIBUTE CERTIFICATE`, the OpenSSL armor -- the canonical-label default
389
+ * `ATTRIBUTE CERTIFICATE`, the OpenSSL armor and the canonical-label default
390
390
  * every sibling format applies). Pass a `label` to enforce a different block
391
391
  * type, or an explicit `null` to take the first block of any type. Throws
392
392
  * `PemError` on a missing / mismatched envelope or a non-base64 body.