micro509 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +123 -6
- package/README.md +3 -0
- package/dist/crypto/crypto.d.ts +2 -3
- package/dist/crypto.d.ts +6 -0
- package/dist/der/der.d.ts +14 -4
- package/dist/der/der.js +19 -19
- package/dist/der.d.ts +26 -2
- package/dist/der.js +4 -4
- package/dist/index.d.ts +82 -15
- package/dist/index.js +19 -19
- package/dist/internal/asn1/asn1.d.ts +1 -2
- package/dist/internal/asn1/der.d.ts +1 -2
- package/dist/internal/asn1/oids.js +71 -353
- package/dist/internal/asn1/oids.js.map +1 -1
- package/dist/internal/asn1/oids.json.js +357 -0
- package/dist/internal/asn1/oids.json.js.map +1 -0
- package/dist/internal/crypto/algorithm-names.js +1 -1
- package/dist/internal/crypto/pbes2.d.ts +1 -2
- package/dist/internal/crypto/pbes2.js +70 -70
- package/dist/internal/crypto/prime-ec.js +37 -0
- package/dist/internal/crypto/prime-ec.js.map +1 -0
- package/dist/internal/crypto/rsa-pss.js +50 -50
- package/dist/internal/crypto/sig-verify.d.ts +1 -2
- package/dist/internal/crypto/sig-verify.js +60 -60
- package/dist/internal/crypto/signing.d.ts +1 -2
- package/dist/internal/crypto/signing.js +26 -26
- package/dist/internal/jose/json-data.js +108 -0
- package/dist/internal/jose/json-data.js.map +1 -0
- package/dist/internal/jose/strict-json.d.ts +1 -2
- package/dist/internal/shared/dn.d.ts +1 -2
- package/dist/internal/shared/dn.js +1 -1
- package/dist/internal/shared/ip.d.ts +1 -2
- package/dist/internal/verify/name-constraints-engine.js +64 -64
- package/dist/internal/verify/policy-engine.js +1 -1
- package/dist/internal/verify/verify-path.d.ts +1 -2
- package/dist/internal/verify/verify-path.js +19 -19
- package/dist/internal/x509/directory-name.js +10 -10
- package/dist/internal/x509/extension-errors.d.ts +1 -2
- package/dist/internal/x509/extension-registry.js +18 -18
- package/dist/internal/x509/general-name-profile.js +9 -9
- package/dist/internal/x509/general-name.js +32 -32
- package/dist/internal/x509/name-fields.js +1 -1
- package/dist/jose/base64url.d.ts +4 -0
- package/dist/jose/base64url.js +14 -0
- package/dist/jose/base64url.js.map +1 -0
- package/dist/jose/errors.d.ts +9 -3
- package/dist/jose/errors.js.map +1 -1
- package/dist/jose/jwe.d.ts +64 -0
- package/dist/jose/jwe.js +188 -0
- package/dist/jose/jwe.js.map +1 -0
- package/dist/jose/jwks.d.ts +38 -10
- package/dist/jose/jwks.js +156 -96
- package/dist/jose/jwks.js.map +1 -1
- package/dist/jose/jws.d.ts +8 -6
- package/dist/jose/jws.js +216 -170
- package/dist/jose/jws.js.map +1 -1
- package/dist/jose/jwt.d.ts +8 -2
- package/dist/jose/jwt.js +98 -98
- package/dist/jose/remote-jwks.d.ts +1 -2
- package/dist/jose/remote-jwks.js +106 -108
- package/dist/jose/remote-jwks.js.map +1 -1
- package/dist/jose.d.ts +15 -4
- package/dist/jose.js +7 -5
- package/dist/kdf/argon2-arithmetic.js +15 -0
- package/dist/kdf/argon2-arithmetic.js.map +1 -0
- package/dist/kdf/argon2-core.js +486 -0
- package/dist/kdf/argon2-core.js.map +1 -0
- package/dist/kdf/argon2-memory.js +20 -0
- package/dist/kdf/argon2-memory.js.map +1 -0
- package/dist/kdf/argon2-portable.js +18 -0
- package/dist/kdf/argon2-portable.js.map +1 -0
- package/dist/kdf/argon2.d.ts +22 -11
- package/dist/kdf/argon2.js +32 -13
- package/dist/kdf/argon2.js.map +1 -1
- package/dist/kdf.d.ts +6 -0
- package/dist/keys/keys.d.ts +31 -6
- package/dist/keys/keys.js +315 -233
- package/dist/keys/keys.js.map +1 -1
- package/dist/keys.d.ts +11 -2
- package/dist/keys.js +2 -2
- package/dist/pem/pem.d.ts +1 -2
- package/dist/pem/pem.js +40 -25
- package/dist/pem/pem.js.map +1 -1
- package/dist/pem.d.ts +6 -0
- package/dist/pkcs/pfx.d.ts +2 -3
- package/dist/pkcs/pfx.js +142 -142
- package/dist/pkcs/pkcs12-mac.d.ts +1 -2
- package/dist/pkcs/pkcs12-mac.js +122 -122
- package/dist/pkcs/pkcs7.d.ts +14 -3
- package/dist/pkcs/pkcs7.js +268 -248
- package/dist/pkcs/pkcs7.js.map +1 -1
- package/dist/pkcs.d.ts +10 -1
- package/dist/pkcs.js +4 -4
- package/dist/result/result.d.ts +1 -2
- package/dist/result.d.ts +6 -0
- package/dist/revocation/chain.d.ts +2 -3
- package/dist/revocation/chain.js +52 -52
- package/dist/revocation/crl.d.ts +2 -3
- package/dist/revocation/crl.js +319 -319
- package/dist/revocation/crl.js.map +1 -1
- package/dist/revocation/ocsp.d.ts +2 -3
- package/dist/revocation/ocsp.js +395 -395
- package/dist/revocation/revocation.d.ts +2 -3
- package/dist/revocation/revocation.js +22 -22
- package/dist/revocation.d.ts +12 -3
- package/dist/revocation.js +4 -4
- package/dist/ssh/ssh.d.ts +2 -3
- package/dist/ssh/ssh.js +165 -170
- package/dist/ssh/ssh.js.map +1 -1
- package/dist/ssh/wire.d.ts +1 -2
- package/dist/ssh/wire.js +10 -10
- package/dist/ssh.d.ts +8 -0
- package/dist/verify/identity.d.ts +1 -2
- package/dist/verify/identity.js +31 -31
- package/dist/verify/name-constraints.d.ts +9 -2
- package/dist/verify/policy.d.ts +9 -2
- package/dist/verify/verify.d.ts +3 -4
- package/dist/verify/verify.js +121 -121
- package/dist/verify.d.ts +9 -0
- package/dist/x509/certificate.d.ts +4 -5
- package/dist/x509/certificate.js +40 -40
- package/dist/x509/csr.d.ts +3 -4
- package/dist/x509/csr.js +15 -15
- package/dist/x509/extensions.d.ts +1 -2
- package/dist/x509/extensions.js +165 -165
- package/dist/x509/extensions.js.map +1 -1
- package/dist/x509/fingerprint.d.ts +1 -2
- package/dist/x509/name-text.d.ts +1 -2
- package/dist/x509/name.d.ts +1 -2
- package/dist/x509/name.js +15 -15
- package/dist/x509/parse.d.ts +3 -4
- package/dist/x509/parse.js +423 -423
- package/dist/x509.d.ts +17 -4
- package/dist/x509.js +8 -8
- package/package.json +27 -34
- package/dist/internal/asn1/oids2.js +0 -75
- package/dist/internal/asn1/oids2.js.map +0 -1
package/dist/x509/certificate.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getCrypto as
|
|
5
|
-
import { base64Encode as
|
|
6
|
-
import { pemEncode as d } from "../pem/pem.js";
|
|
1
|
+
import { rethrowDecodeRefusal as e } from "../internal/asn1/decode-refusal.js";
|
|
2
|
+
import { bitString as t, explicitContext as n, integer as r, integerFromNumber as i, sequence as a, time as o } from "../internal/asn1/der.js";
|
|
3
|
+
import { encodeAlgorithmIdentifier as s, getSignatureAlgorithm as c, signBytes as l } from "../internal/crypto/signing.js";
|
|
4
|
+
import { getCrypto as u } from "../internal/crypto/webcrypto.js";
|
|
5
|
+
import { base64Encode as d } from "../internal/shared/base64.js";
|
|
7
6
|
import { exportSpkiDer as f, generateKeyPair as p } from "../keys/keys.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { buildCertificateExtensions as
|
|
7
|
+
import { pemEncode as m } from "../pem/pem.js";
|
|
8
|
+
import { DECODE_REFUSAL_CODES as h, throwMicro509Error as g } from "../result/result.js";
|
|
9
|
+
import { buildCertificateExtensions as _, buildSubjectKeyIdentifier as v, issuerKeyIdentifier as y } from "./extensions.js";
|
|
10
|
+
import { encodeName as b, isNameInputEmpty as x } from "./name.js";
|
|
11
11
|
import { parseCertificateFromSource as S } from "./parse.js";
|
|
12
12
|
// src/x509/certificate.ts
|
|
13
13
|
/**
|
|
@@ -82,31 +82,31 @@ function createCertificate(e) {
|
|
|
82
82
|
* `input.issuerCertificate`, or from its own subject key when `authority` is
|
|
83
83
|
* `'subject'` (RFC 5280 §4.2.1.1).
|
|
84
84
|
*/
|
|
85
|
-
async function issueCertificate(e,
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
let
|
|
89
|
-
|
|
85
|
+
async function issueCertificate(e, r) {
|
|
86
|
+
let u = await f(e.publicKey), d = r === "subject" ? v(u) : e.issuerCertificate === void 0 ? void 0 : y(issuerCertificateOf(e.issuerCertificate)), p = c(e.signerPrivateKey, e.signature), m = resolveValidity(e.validity);
|
|
87
|
+
x(e.issuer) && g("issuer_distinguished_name_empty", "issuer must be a non-empty distinguished name");
|
|
88
|
+
let h = x(e.subject), S = _(u, d, e.extensions, h), C = a([
|
|
89
|
+
n(0, i(2)),
|
|
90
90
|
encodeSerialNumber(e.serialNumber),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
]), w = await
|
|
98
|
-
return materializeCertificate(
|
|
91
|
+
s(p),
|
|
92
|
+
b(e.issuer),
|
|
93
|
+
a([o(m.notBefore), o(m.notAfter)]),
|
|
94
|
+
b(e.subject),
|
|
95
|
+
u,
|
|
96
|
+
n(3, a(S))
|
|
97
|
+
]), w = await l(e.signerPrivateKey, p, C);
|
|
98
|
+
return materializeCertificate(a([
|
|
99
99
|
C,
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
s(p),
|
|
101
|
+
t(w)
|
|
102
102
|
]));
|
|
103
103
|
}
|
|
104
104
|
/** The parsed issuer certificate of a certificate being built. */
|
|
105
|
-
function issuerCertificateOf(
|
|
105
|
+
function issuerCertificateOf(t) {
|
|
106
106
|
try {
|
|
107
|
-
return S(
|
|
108
|
-
} catch (
|
|
109
|
-
return
|
|
107
|
+
return S(t);
|
|
108
|
+
} catch (t) {
|
|
109
|
+
return e(t, h), g("issuer_certificate_invalid", "issuerCertificate must be a PEM, DER or parsed certificate");
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
@@ -118,8 +118,8 @@ function issuerCertificateOf(r) {
|
|
|
118
118
|
function materializeCertificate(e) {
|
|
119
119
|
return {
|
|
120
120
|
der: e,
|
|
121
|
-
pem:
|
|
122
|
-
base64:
|
|
121
|
+
pem: m("CERTIFICATE", e),
|
|
122
|
+
base64: d(e)
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
@@ -129,10 +129,10 @@ function materializeCertificate(e) {
|
|
|
129
129
|
* @returns A concrete `notBefore` and `notAfter` pair.
|
|
130
130
|
*/
|
|
131
131
|
function resolveValidity(e) {
|
|
132
|
-
let
|
|
133
|
-
return (Number.isNaN(
|
|
134
|
-
notBefore:
|
|
135
|
-
notAfter:
|
|
132
|
+
let t = e?.notBefore ?? /* @__PURE__ */ new Date(), n = e?.notAfter ?? addDays(t, e?.days ?? 30);
|
|
133
|
+
return (Number.isNaN(t.getTime()) || Number.isNaN(n.getTime())) && g("validity_date_invalid", "notBefore and notAfter must be valid dates"), n.getTime() <= t.getTime() && g("validity_not_after_before_not_before", "notAfter must be after notBefore"), {
|
|
134
|
+
notBefore: t,
|
|
135
|
+
notAfter: n
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
@@ -155,11 +155,11 @@ function addDays(e, t) {
|
|
|
155
155
|
* `serial_number_too_long` when RFC 5280 §4.1.2.2 forbids the value.
|
|
156
156
|
*/
|
|
157
157
|
function encodeSerialNumber(e) {
|
|
158
|
-
if (e === void 0) return
|
|
159
|
-
let
|
|
160
|
-
for (;
|
|
161
|
-
let
|
|
162
|
-
return i === void 0 &&
|
|
158
|
+
if (e === void 0) return r(randomSerialNumber());
|
|
159
|
+
let t = 0;
|
|
160
|
+
for (; t < e.length && e[t] === 0;) t += 1;
|
|
161
|
+
let n = e.subarray(t), i = n[0];
|
|
162
|
+
return i === void 0 && g("serial_number_not_positive", "serialNumber must be a positive integer"), n.length + +(i >= 128) > 20 && g("serial_number_too_long", "serialNumber must not exceed 20 octets"), r(n);
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Generate a random positive serial number suitable for certificate issuance.
|
|
@@ -167,7 +167,7 @@ function encodeSerialNumber(e) {
|
|
|
167
167
|
* @returns A 16-byte positive serial number.
|
|
168
168
|
*/
|
|
169
169
|
function randomSerialNumber() {
|
|
170
|
-
let e =
|
|
170
|
+
let e = u().getRandomValues(/* @__PURE__ */ new Uint8Array(16));
|
|
171
171
|
return e[0] = (e[0] ?? 0) & 127, (e[0] ?? 0) === 0 && (e[0] = 1), e;
|
|
172
172
|
}
|
|
173
173
|
export { createCertificate, createSelfSignedCertificate };
|
package/dist/x509/csr.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SignatureProfileInput } from "../internal/crypto/signing.js";
|
|
2
2
|
import { canonicalDnKey, compareDistinguishedNames, isWithinDirectoryNameSubtree } from "../internal/shared/dn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { AuthorityInfoAccessMethod, AuthorityInformationAccess, AuthorityInformationAccessInput, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, CpsPolicyQualifierInfo, CustomAuthorityInfoAccessMethod, CustomExtendedKeyUsage, CustomExtension, CustomPolicyQualifierInfo, DisplayTextType, DistributionPoint, DistributionPointName, DistributionPointReason, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts, KeyUsage, KnownAuthorityInfoAccessMethod, KnownExtendedKeyUsage, NameConstraintForm, NameConstraints, OversizedDisplayText, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyNoticeReference, PolicyQualifierInfo, SubjectAltName, UnsupportedNameConstraintForm, UserNoticePolicyQualifierInfo, buildCertificateExtensions, buildRequestedExtensions, buildSubjectKeyIdentifier, encodeAuthorityInfoAccess, encodeBasicConstraints, encodeCertificatePolicies, encodeCrlDistributionPoints, encodeExtendedKeyUsage, encodeExtension, encodeInhibitAnyPolicy, encodeKeyUsage, encodeNameConstraints, encodePolicyConstraints, encodePolicyMappings, encodeSubjectAltName, getAuthorityInfoAccessMethodOid, getExtendedKeyUsageOid, parseAuthorityInfoAccessMethodOid, parseExtendedKeyUsageOid } from "./extensions.js";
|
|
4
4
|
import { ExtensionEncoderErrorCode } from "../internal/x509/extension-errors.js";
|
|
5
5
|
import { allOnesMaskForIpAddress, decodeIpAddress, normalizeIpAddress, parseIpAddressToBytes } from "../internal/shared/ip.js";
|
|
6
|
-
import {
|
|
6
|
+
import { NameAttribute, NameEncoderErrorCode, NameFieldKey, NameInput, NameObject, RelativeDistinguishedNameInput, encodeName, encodeRelativeDistinguishedName } from "./name.js";
|
|
7
7
|
/** Input for {@linkcode createCertificateSigningRequest}. */
|
|
8
8
|
export interface CreateCsrInput {
|
|
9
9
|
/** Distinguished name for the CSR subject (e.g. `{ commonName: 'example.com' }`). */
|
|
@@ -51,5 +51,4 @@ export interface CsrMaterial {
|
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
export declare function createCertificateSigningRequest(input: CreateCsrInput): Promise<CsrMaterial>;
|
|
54
|
-
export type { AuthorityInfoAccessMethod, AuthorityInformationAccess, AuthorityInformationAccessInput, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, CpsPolicyQualifierInfo, CustomAuthorityInfoAccessMethod, CustomExtendedKeyUsage, CustomExtension, CustomPolicyQualifierInfo, DisplayTextType, DistributionPoint, DistributionPointName, DistributionPointReason, ExtendedKeyUsage, ExtensionEncoderErrorCode, GeneralName, GeneralSubtree, InhibitAnyPolicy, IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts, KeyUsage, KnownAuthorityInfoAccessMethod, KnownExtendedKeyUsage, NameConstraintForm, NameConstraints, NameEncoderErrorCode, NameInput, NameObject, OversizedDisplayText, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyNoticeReference, PolicyQualifierInfo, SubjectAltName, UnsupportedNameConstraintForm, UserNoticePolicyQualifierInfo, allOnesMaskForIpAddress, buildCertificateExtensions, buildRequestedExtensions, buildSubjectKeyIdentifier, canonicalDnKey, compareDistinguishedNames, decodeIpAddress, encodeAuthorityInfoAccess, encodeBasicConstraints, encodeCertificatePolicies, encodeCrlDistributionPoints, encodeExtendedKeyUsage, encodeExtension, encodeInhibitAnyPolicy, encodeKeyUsage, encodeName, encodeNameConstraints, encodePolicyConstraints, encodePolicyMappings, encodeRelativeDistinguishedName, encodeSubjectAltName, getAuthorityInfoAccessMethodOid, getExtendedKeyUsageOid, isWithinDirectoryNameSubtree, normalizeIpAddress, parseAuthorityInfoAccessMethodOid, parseExtendedKeyUsageOid, parseIpAddressToBytes };
|
|
55
|
-
//# sourceMappingURL=csr.d.ts.map
|
|
54
|
+
export type { AuthorityInfoAccessMethod, AuthorityInformationAccess, AuthorityInformationAccessInput, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, CpsPolicyQualifierInfo, CustomAuthorityInfoAccessMethod, CustomExtendedKeyUsage, CustomExtension, CustomPolicyQualifierInfo, DisplayTextType, DistributionPoint, DistributionPointName, DistributionPointReason, ExtendedKeyUsage, ExtensionEncoderErrorCode, GeneralName, GeneralSubtree, InhibitAnyPolicy, IssuingDistributionPoint, IssuingDistributionPointBase, IssuingDistributionPointForAttributeCerts, IssuingDistributionPointForCaCerts, IssuingDistributionPointForUserCerts, KeyUsage, KnownAuthorityInfoAccessMethod, KnownExtendedKeyUsage, NameConstraintForm, NameConstraints, NameEncoderErrorCode, NameInput, NameObject, OversizedDisplayText, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyNoticeReference, PolicyQualifierInfo, SubjectAltName, UnsupportedNameConstraintForm, UserNoticePolicyQualifierInfo, allOnesMaskForIpAddress, buildCertificateExtensions, buildRequestedExtensions, buildSubjectKeyIdentifier, canonicalDnKey, compareDistinguishedNames, decodeIpAddress, encodeAuthorityInfoAccess, encodeBasicConstraints, encodeCertificatePolicies, encodeCrlDistributionPoints, encodeExtendedKeyUsage, encodeExtension, encodeInhibitAnyPolicy, encodeKeyUsage, encodeName, encodeNameConstraints, encodePolicyConstraints, encodePolicyMappings, encodeRelativeDistinguishedName, encodeSubjectAltName, getAuthorityInfoAccessMethodOid, getExtendedKeyUsageOid, isWithinDirectoryNameSubtree, normalizeIpAddress, parseAuthorityInfoAccessMethodOid, parseExtendedKeyUsageOid, parseIpAddressToBytes };
|
package/dist/x509/csr.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { bitString as e, concatBytes as t, implicitConstructedContext as n, integerFromNumber as r, objectIdentifier as i, sequence as a, setOf as o } from "../internal/asn1/der.js";
|
|
2
|
-
import { OIDS as s } from "../internal/asn1/
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { exportSpkiDer as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { OIDS as s } from "../internal/asn1/oids.js";
|
|
3
|
+
import { encodeAlgorithmIdentifier as c, getSignatureAlgorithm as l, signBytes as u } from "../internal/crypto/signing.js";
|
|
4
|
+
import { base64Encode as d } from "../internal/shared/base64.js";
|
|
5
|
+
import { exportSpkiDer as f } from "../keys/keys.js";
|
|
6
|
+
import { pemEncode as p } from "../pem/pem.js";
|
|
7
|
+
import { buildRequestedExtensions as m } from "./extensions.js";
|
|
8
|
+
import { encodeName as h } from "./name.js";
|
|
9
9
|
// src/x509/csr.ts
|
|
10
10
|
/**
|
|
11
11
|
* PKCS#10 Certificate Signing Request (CSR) creation.
|
|
@@ -40,25 +40,25 @@ import { buildRequestedExtensions as h } from "./extensions.js";
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
async function createCertificateSigningRequest(i) {
|
|
43
|
-
let o =
|
|
43
|
+
let o = l(i.signerPrivateKey, i.signature), s = await f(i.publicKey), m = buildAttributes(i.extensions), g = a([
|
|
44
44
|
r(0),
|
|
45
|
-
|
|
45
|
+
h(i.subject),
|
|
46
46
|
s,
|
|
47
|
-
n(0, t(
|
|
48
|
-
]), _ = await
|
|
47
|
+
n(0, t(m))
|
|
48
|
+
]), _ = await u(i.signerPrivateKey, o, g), v = a([
|
|
49
49
|
g,
|
|
50
|
-
|
|
50
|
+
c(o),
|
|
51
51
|
e(_)
|
|
52
52
|
]);
|
|
53
53
|
return {
|
|
54
54
|
der: v,
|
|
55
|
-
pem:
|
|
56
|
-
base64:
|
|
55
|
+
pem: p("CERTIFICATE REQUEST", v),
|
|
56
|
+
base64: d(v)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
/** Encodes extensions into a CSR extensionRequest attribute, or returns empty. */
|
|
60
60
|
function buildAttributes(e) {
|
|
61
|
-
let t =
|
|
61
|
+
let t = m(e);
|
|
62
62
|
return t.length === 0 ? [] : [a([i(s.extensionRequest), o([a(t)])])];
|
|
63
63
|
}
|
|
64
64
|
export { createCertificateSigningRequest };
|
|
@@ -729,5 +729,4 @@ export declare function parseAuthorityInfoAccessMethodOid(oid: string): Authorit
|
|
|
729
729
|
* A parsed certificate carries the input as `subjectPublicKeyInfoDer`.
|
|
730
730
|
*/
|
|
731
731
|
export declare function buildSubjectKeyIdentifier(subjectPublicKeyInfo: Uint8Array): Uint8Array;
|
|
732
|
-
export { type ExtensionEncoderErrorCode, allOnesMaskForIpAddress, decodeIpAddress, normalizeIpAddress, parseIpAddressToBytes };
|
|
733
|
-
//# sourceMappingURL=extensions.d.ts.map
|
|
732
|
+
export { type ExtensionEncoderErrorCode, allOnesMaskForIpAddress, decodeIpAddress, normalizeIpAddress, parseIpAddressToBytes };
|