micro509 0.12.0 → 0.14.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/README.md +78 -30
- package/dist/crypto/crypto.d.ts +73 -0
- package/dist/crypto/crypto.js +74 -0
- package/dist/crypto/crypto.js.map +1 -0
- package/dist/crypto.d.ts +4 -0
- package/dist/crypto.js +2 -0
- package/dist/der/der.d.ts +127 -0
- package/dist/der/der.js +171 -0
- package/dist/der/der.js.map +1 -0
- package/dist/der.d.ts +4 -0
- package/dist/der.js +4 -0
- package/dist/index.d.ts +13 -9
- package/dist/index.js +17 -15
- package/dist/internal/asn1/asn1.d.ts +20 -0
- package/dist/internal/asn1/asn1.js +80 -37
- package/dist/internal/asn1/asn1.js.map +1 -1
- package/dist/internal/asn1/der.d.ts +173 -0
- package/dist/internal/asn1/der.js +116 -38
- package/dist/internal/asn1/der.js.map +1 -1
- package/dist/internal/asn1/oids.js +7 -1
- package/dist/internal/asn1/oids2.js +9 -2
- package/dist/internal/asn1/oids2.js.map +1 -1
- package/dist/internal/crypto/algorithm-names.js +4 -0
- package/dist/internal/crypto/algorithm-names.js.map +1 -1
- package/dist/internal/crypto/pbes2.d.ts +38 -0
- package/dist/internal/crypto/pbes2.js +9 -10
- package/dist/internal/crypto/pbes2.js.map +1 -1
- package/dist/internal/crypto/rsa-pss.js +2 -0
- package/dist/internal/crypto/rsa-pss.js.map +1 -1
- package/dist/internal/crypto/sig-verify.d.ts +31 -0
- package/dist/internal/crypto/sig-verify.js +10 -8
- package/dist/internal/crypto/sig-verify.js.map +1 -1
- package/dist/internal/shared/base64.js +7 -1
- package/dist/internal/shared/base64.js.map +1 -1
- package/dist/internal/shared/dn.d.ts +16 -0
- package/dist/internal/shared/dn.js +149 -12
- package/dist/internal/shared/dn.js.map +1 -1
- package/dist/internal/shared/ip.d.ts +69 -0
- package/dist/internal/shared/ip.js +18 -1
- package/dist/internal/shared/ip.js.map +1 -1
- package/dist/internal/shared/rfc3454-tables.js +1782 -0
- package/dist/internal/shared/rfc3454-tables.js.map +1 -0
- package/dist/internal/verify/name-constraints-engine.js +47 -15
- package/dist/internal/verify/name-constraints-engine.js.map +1 -1
- package/dist/internal/verify/policy-engine.js +85 -94
- package/dist/internal/verify/policy-engine.js.map +1 -1
- package/dist/internal/verify/verify-path.d.ts +7 -0
- package/dist/internal/verify/verify-path.js +49 -45
- package/dist/internal/verify/verify-path.js.map +1 -1
- package/dist/internal/x509/directory-name.js +24 -0
- package/dist/internal/x509/directory-name.js.map +1 -0
- package/dist/internal/x509/extension-bits.js +14 -11
- package/dist/internal/x509/extension-bits.js.map +1 -1
- package/dist/internal/x509/extension-errors.d.ts +6 -0
- package/dist/internal/x509/extension-errors.js +20 -0
- package/dist/internal/x509/extension-errors.js.map +1 -0
- package/dist/internal/x509/extension-registry.js +113 -55
- package/dist/internal/x509/extension-registry.js.map +1 -1
- package/dist/internal/x509/general-name-tags.js +28 -0
- package/dist/internal/x509/general-name-tags.js.map +1 -0
- package/dist/internal/x509/general-name.js +97 -0
- package/dist/internal/x509/general-name.js.map +1 -0
- package/dist/internal/x509/name-fields.js +20 -10
- package/dist/internal/x509/name-fields.js.map +1 -1
- package/dist/keys/keys.d.ts +16 -2
- package/dist/keys/keys.js +311 -170
- package/dist/keys/keys.js.map +1 -1
- package/dist/keys.d.ts +3 -2
- package/dist/keys.js +3 -2
- package/dist/pem/pem.d.ts +3 -2
- package/dist/pem/pem.js +112 -30
- package/dist/pem/pem.js.map +1 -1
- package/dist/pkcs/pkcs12-mac.js +3 -3
- package/dist/pkcs/pkcs12-mac.js.map +1 -1
- package/dist/pkcs/pkcs7.d.ts +85 -21
- package/dist/pkcs/pkcs7.js +261 -186
- package/dist/pkcs/pkcs7.js.map +1 -1
- package/dist/pkcs.d.ts +2 -2
- package/dist/result/result.d.ts +18 -10
- package/dist/result/result.js +20 -12
- package/dist/result/result.js.map +1 -1
- package/dist/result.d.ts +2 -2
- package/dist/result.js +2 -2
- package/dist/revocation/chain.js +154 -103
- package/dist/revocation/chain.js.map +1 -1
- package/dist/revocation/crl.d.ts +13 -2
- package/dist/revocation/crl.js +415 -236
- package/dist/revocation/crl.js.map +1 -1
- package/dist/revocation/ocsp.d.ts +58 -17
- package/dist/revocation/ocsp.js +186 -174
- package/dist/revocation/ocsp.js.map +1 -1
- package/dist/revocation/revocation.d.ts +4 -4
- package/dist/revocation/revocation.js +48 -30
- package/dist/revocation/revocation.js.map +1 -1
- package/dist/revocation.d.ts +4 -4
- package/dist/revocation.js +5 -5
- package/dist/verify/identity.d.ts +2 -1
- package/dist/verify/identity.js +2 -1
- package/dist/verify/identity.js.map +1 -1
- package/dist/verify/policy.d.ts +6 -1
- package/dist/verify/verify.d.ts +18 -3
- package/dist/verify/verify.js +66 -41
- package/dist/verify/verify.js.map +1 -1
- package/dist/verify.d.ts +2 -1
- package/dist/verify.js +4 -3
- package/dist/x509/certificate.d.ts +36 -13
- package/dist/x509/certificate.js +36 -19
- package/dist/x509/certificate.js.map +1 -1
- package/dist/x509/csr.d.ts +6 -3
- package/dist/x509/extensions.d.ts +59 -22
- package/dist/x509/extensions.js +384 -117
- package/dist/x509/extensions.js.map +1 -1
- package/dist/x509/name-text.js +2 -0
- package/dist/x509/name-text.js.map +1 -1
- package/dist/x509/name.d.ts +8 -5
- package/dist/x509/name.js +17 -12
- package/dist/x509/name.js.map +1 -1
- package/dist/x509/parse.d.ts +104 -18
- package/dist/x509/parse.js +127 -163
- package/dist/x509/parse.js.map +1 -1
- package/dist/x509.d.ts +8 -5
- package/dist/x509.js +10 -8
- package/package.json +52 -34
package/dist/x509.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { NameAttribute, NameFieldKey, NameInput, NameObject, RelativeDistinguishedNameInput, encodeName, encodeRelativeDistinguishedName } from "./x509/name.js";
|
|
2
|
-
import { AuthorityInfoAccessMethod, AuthorityInformationAccess, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, CpsPolicyQualifierInfo, CustomAuthorityInfoAccessMethod, CustomExtendedKeyUsage, CustomExtension, CustomPolicyQualifierInfo, DistributionPoint, DistributionPointName, DistributionPointReason, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, KeyUsage, KnownAuthorityInfoAccessMethod, KnownExtendedKeyUsage, NameConstraintForm, NameConstraints, ParsedBitFlags, ParsedNameConstraintForm, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyNoticeReference, PolicyQualifierInfo, SubjectAltName, UnsupportedNameConstraintForm, UserNoticePolicyQualifierInfo, buildCertificateExtensions, buildRequestedExtensions, encodeAuthorityInfoAccess, encodeBasicConstraints, encodeCertificatePolicies, encodeCrlDistributionPoints, encodeExtendedKeyUsage, encodeExtension, encodeInhibitAnyPolicy, encodeKeyUsage, encodeNameConstraints, encodePolicyConstraints, encodePolicyMappings, encodeSubjectAltName, getAuthorityInfoAccessMethodOid, getExtendedKeyUsageOid, parseAuthorityInfoAccessMethodOid, parseExtendedKeyUsageOid } from "./x509/extensions.js";
|
|
3
|
-
import { DecodedExtensionMap, DecodedExtensionValue, ExtensionDecoder, ExtensionDecoderMap, MatchCertificatePrivateKeyErrorCode, MatchCertificatePrivateKeyFailure, MatchCertificatePrivateKeyFailureResult, MatchCertificatePrivateKeyResult, MatchCertificatePrivateKeySuccess, ParseCertificateErrorCode, ParseCertificateFailure, ParseCertificateResult, ParseCertificateSigningRequestErrorCode, ParseCertificateSigningRequestFailure, ParseCertificateSigningRequestResult, ParseOptions, ParsedCertificate, ParsedCertificateSigningRequest, ParsedDistributionPoint, ParsedDistributionPointName, ParsedExtension, ParsedName, ParsedNameAttribute, ParsedRelativeDistinguishedName, certificateMatchesPrivateKey, decodeExtension, decodeExtensionMap, decodeExtensions, defineExtensionDecoder, defineExtensionDecoderMap, findExtension, getSubjectPublicKey, getSubjectPublicKeyOrThrow, matchCertificatePrivateKey, parseCertificateChainPem, parseCertificateDer, parseCertificateDerOrThrow, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow } from "./x509/parse.js";
|
|
4
1
|
import { SignatureProfileInput } from "./internal/crypto/signing.js";
|
|
5
|
-
import {
|
|
2
|
+
import { canonicalDnKey, compareDistinguishedNames, isWithinDirectoryNameSubtree } from "./internal/shared/dn.js";
|
|
3
|
+
import { NameAttribute, NameEncoderErrorCode, NameFieldKey, NameInput, NameObject, RelativeDistinguishedNameInput, encodeName, encodeRelativeDistinguishedName } from "./x509/name.js";
|
|
4
|
+
import { ExtensionEncoderErrorCode } from "./internal/x509/extension-errors.js";
|
|
5
|
+
import { allOnesMaskForIpAddress, decodeIpAddress, normalizeIpAddress, parseIpAddressToBytes } from "./internal/shared/ip.js";
|
|
6
|
+
import { AuthorityInfoAccessMethod, AuthorityInformationAccess, AuthorityInformationAccessInput, BasicConstraints, CertificateExtensionsInput, CertificatePolicies, CpsPolicyQualifierInfo, CustomAuthorityInfoAccessMethod, CustomExtendedKeyUsage, CustomExtension, CustomPolicyQualifierInfo, DistributionPoint, DistributionPointName, DistributionPointReason, ExtendedKeyUsage, GeneralName, GeneralSubtree, InhibitAnyPolicy, KeyUsage, KnownAuthorityInfoAccessMethod, KnownExtendedKeyUsage, NameConstraintForm, NameConstraints, 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 "./x509/extensions.js";
|
|
7
|
+
import { DecodedExtensionMap, DecodedExtensionValue, ExtensionDecoder, ExtensionDecoderMap, MatchCertificatePrivateKeyErrorCode, MatchCertificatePrivateKeyFailure, MatchCertificatePrivateKeyFailureResult, MatchCertificatePrivateKeyResult, MatchCertificatePrivateKeySuccess, ParseCertificateChainResult, ParseCertificateErrorCode, ParseCertificateFailure, ParseCertificateResult, ParseCertificateSigningRequestErrorCode, ParseCertificateSigningRequestFailure, ParseCertificateSigningRequestResult, ParseOptions, ParsedCertificate, ParsedCertificateSigningRequest, ParsedDistributionPoint, ParsedDistributionPointName, ParsedExtension, ParsedName, ParsedNameAttribute, ParsedRelativeDistinguishedName, certificateMatchesPrivateKey, decodeExtension, decodeExtensionMap, decodeExtensions, defineExtensionDecoder, defineExtensionDecoderMap, findExtension, getSubjectPublicKey, getSubjectPublicKeyOrThrow, matchCertificatePrivateKey, parseAuthorityInfoAccess, parseAuthorityKeyIdentifier, parseBasicConstraints, parseCertificateChainPem, parseCertificateChainPemOrThrow, parseCertificateDer, parseCertificateDerOrThrow, parseCertificateFromSource, parseCertificatePem, parseCertificatePemOrThrow, parseCertificatePolicies, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseCertificatesFromSource, parseCrlDistributionPoints, parseDistinguishedNameDer, parseExtendedKeyUsage, parseInhibitAnyPolicy, parseKeyUsage, parseNameConstraints, parsePolicyConstraints, parsePolicyMappings, parseSubjectAltNames } from "./x509/parse.js";
|
|
8
|
+
import { CertificateMaterial, CreateCertificateErrorCode, CreateCertificateInput, CreateSelfSignedCertificateBase, CreateSelfSignedCertificateInput, SelfSignedCertificateResult, SelfSignedKeySource, ValidityInput, createCertificate, createSelfSignedCertificate } from "./x509/certificate.js";
|
|
6
9
|
import { CreateCsrInput, CsrMaterial, createCertificateSigningRequest } from "./x509/csr.js";
|
|
7
10
|
import { CertificateFingerprint, CertificateFingerprintAlgorithm, CertificateFingerprintSource, certificateFingerprint } from "./x509/fingerprint.js";
|
|
8
11
|
import { SubjectAltNameTextOptions, distinguishedNameToString, relativeDistinguishedNameToString, subjectAltNameLabel, subjectAltNameToString } from "./x509/name-text.js";
|
|
9
|
-
export { type AuthorityInfoAccessMethod, type AuthorityInformationAccess, type BasicConstraints, type CertificateExtensionsInput, type CertificateFingerprint, type CertificateFingerprintAlgorithm, type CertificateFingerprintSource, type CertificateMaterial, type CertificatePolicies, type CpsPolicyQualifierInfo, type CreateCertificateInput, type CreateCsrInput, type CreateSelfSignedCertificateInput, type CsrMaterial, type CustomAuthorityInfoAccessMethod, type CustomExtendedKeyUsage, type CustomExtension, type CustomPolicyQualifierInfo, type DecodedExtensionMap, type DecodedExtensionValue, type DistributionPoint, type DistributionPointName, type DistributionPointReason, type ExtendedKeyUsage, type ExtensionDecoder, type ExtensionDecoderMap, type GeneralName, type GeneralSubtree, type InhibitAnyPolicy, type KeyUsage, type KnownAuthorityInfoAccessMethod, type KnownExtendedKeyUsage, type MatchCertificatePrivateKeyErrorCode, type MatchCertificatePrivateKeyFailure, type MatchCertificatePrivateKeyFailureResult, type MatchCertificatePrivateKeyResult, type MatchCertificatePrivateKeySuccess, type NameAttribute, type NameConstraintForm, type NameConstraints, type NameFieldKey, type NameInput, type NameObject, type ParseCertificateErrorCode, type ParseCertificateFailure, type ParseCertificateResult, type ParseCertificateSigningRequestErrorCode, type ParseCertificateSigningRequestFailure, type ParseCertificateSigningRequestResult, type ParseOptions, type ParsedBitFlags, type ParsedCertificate, type ParsedCertificateSigningRequest, type ParsedDistributionPoint, type ParsedDistributionPointName, type ParsedExtension, type ParsedName, type ParsedNameAttribute, type ParsedNameConstraintForm, type ParsedRelativeDistinguishedName, type PolicyConstraints, type PolicyInformation, type PolicyMapping, type PolicyMappings, type PolicyNoticeReference, type PolicyQualifierInfo, type RelativeDistinguishedNameInput, type SelfSignedCertificateResult, type SignatureProfileInput, type SubjectAltName, type SubjectAltNameTextOptions, type UnsupportedNameConstraintForm, type UserNoticePolicyQualifierInfo, type ValidityInput, buildCertificateExtensions, buildRequestedExtensions, certificateFingerprint, certificateMatchesPrivateKey, createCertificate, createCertificateSigningRequest, createSelfSignedCertificate, decodeExtension, decodeExtensionMap, decodeExtensions, defineExtensionDecoder, defineExtensionDecoderMap, distinguishedNameToString, encodeAuthorityInfoAccess, encodeBasicConstraints, encodeCertificatePolicies, encodeCrlDistributionPoints, encodeExtendedKeyUsage, encodeExtension, encodeInhibitAnyPolicy, encodeKeyUsage, encodeName, encodeNameConstraints, encodePolicyConstraints, encodePolicyMappings, encodeRelativeDistinguishedName, encodeSubjectAltName, findExtension, getAuthorityInfoAccessMethodOid, getExtendedKeyUsageOid, getSubjectPublicKey, getSubjectPublicKeyOrThrow, matchCertificatePrivateKey, parseAuthorityInfoAccessMethodOid, parseCertificateChainPem, parseCertificateDer, parseCertificateDerOrThrow, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseExtendedKeyUsageOid, relativeDistinguishedNameToString, subjectAltNameLabel, subjectAltNameToString };
|
|
12
|
+
export { type AuthorityInfoAccessMethod, type AuthorityInformationAccess, type AuthorityInformationAccessInput, type BasicConstraints, type CertificateExtensionsInput, type CertificateFingerprint, type CertificateFingerprintAlgorithm, type CertificateFingerprintSource, type CertificateMaterial, type CertificatePolicies, type CpsPolicyQualifierInfo, type CreateCertificateErrorCode, type CreateCertificateInput, type CreateCsrInput, type CreateSelfSignedCertificateBase, type CreateSelfSignedCertificateInput, type CsrMaterial, type CustomAuthorityInfoAccessMethod, type CustomExtendedKeyUsage, type CustomExtension, type CustomPolicyQualifierInfo, type DecodedExtensionMap, type DecodedExtensionValue, type DistributionPoint, type DistributionPointName, type DistributionPointReason, type ExtendedKeyUsage, type ExtensionDecoder, type ExtensionDecoderMap, type ExtensionEncoderErrorCode, type GeneralName, type GeneralSubtree, type InhibitAnyPolicy, type KeyUsage, type KnownAuthorityInfoAccessMethod, type KnownExtendedKeyUsage, type MatchCertificatePrivateKeyErrorCode, type MatchCertificatePrivateKeyFailure, type MatchCertificatePrivateKeyFailureResult, type MatchCertificatePrivateKeyResult, type MatchCertificatePrivateKeySuccess, type NameAttribute, type NameConstraintForm, type NameConstraints, type NameEncoderErrorCode, type NameFieldKey, type NameInput, type NameObject, type ParseCertificateChainResult, type ParseCertificateErrorCode, type ParseCertificateFailure, type ParseCertificateResult, type ParseCertificateSigningRequestErrorCode, type ParseCertificateSigningRequestFailure, type ParseCertificateSigningRequestResult, type ParseOptions, type ParsedBitFlags, type ParsedCertificate, type ParsedCertificateSigningRequest, type ParsedDistributionPoint, type ParsedDistributionPointName, type ParsedExtension, type ParsedName, type ParsedNameAttribute, type ParsedNameConstraintForm, type ParsedRelativeDistinguishedName, type PolicyConstraints, type PolicyInformation, type PolicyMapping, type PolicyMappings, type PolicyNoticeReference, type PolicyQualifierInfo, type RelativeDistinguishedNameInput, type SelfSignedCertificateResult, type SelfSignedKeySource, type SignatureProfileInput, type SubjectAltName, type SubjectAltNameTextOptions, type UnsupportedNameConstraintForm, type UserNoticePolicyQualifierInfo, type ValidityInput, allOnesMaskForIpAddress, buildCertificateExtensions, buildRequestedExtensions, canonicalDnKey, certificateFingerprint, certificateMatchesPrivateKey, compareDistinguishedNames, createCertificate, createCertificateSigningRequest, createSelfSignedCertificate, parseAuthorityInfoAccess as decodeAuthorityInfoAccess, parseAuthorityKeyIdentifier as decodeAuthorityKeyIdentifier, parseBasicConstraints as decodeBasicConstraints, parseCertificatePolicies as decodeCertificatePolicies, parseCrlDistributionPoints as decodeCrlDistributionPoints, parseExtendedKeyUsage as decodeExtendedKeyUsage, decodeExtension, decodeExtensionMap, decodeExtensions, parseInhibitAnyPolicy as decodeInhibitAnyPolicy, decodeIpAddress, parseKeyUsage as decodeKeyUsage, parseNameConstraints as decodeNameConstraints, parsePolicyConstraints as decodePolicyConstraints, parsePolicyMappings as decodePolicyMappings, parseSubjectAltNames as decodeSubjectAltNames, defineExtensionDecoder, defineExtensionDecoderMap, distinguishedNameToString, encodeAuthorityInfoAccess, encodeBasicConstraints, encodeCertificatePolicies, encodeCrlDistributionPoints, encodeExtendedKeyUsage, encodeExtension, encodeInhibitAnyPolicy, encodeKeyUsage, encodeName, encodeNameConstraints, encodePolicyConstraints, encodePolicyMappings, encodeRelativeDistinguishedName, encodeSubjectAltName, findExtension, getAuthorityInfoAccessMethodOid, getExtendedKeyUsageOid, getSubjectPublicKey, getSubjectPublicKeyOrThrow, isWithinDirectoryNameSubtree, matchCertificatePrivateKey, normalizeIpAddress, parseAuthorityInfoAccessMethodOid, parseCertificateChainPem, parseCertificateChainPemOrThrow, parseCertificateDer, parseCertificateDerOrThrow, parseCertificateFromSource, parseCertificatePem, parseCertificatePemOrThrow, parseCertificateSigningRequestDer, parseCertificateSigningRequestDerOrThrow, parseCertificateSigningRequestPem, parseCertificateSigningRequestPemOrThrow, parseCertificatesFromSource, parseDistinguishedNameDer, parseExtendedKeyUsageOid, parseIpAddressToBytes, relativeDistinguishedNameToString, subjectAltNameLabel, subjectAltNameToString, buildSubjectKeyIdentifier as subjectKeyIdentifier };
|
package/dist/x509.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { allOnesMaskForIpAddress as e, decodeIpAddress as t, normalizeIpAddress as n, parseIpAddressToBytes as r } from "./internal/shared/ip.js";
|
|
2
|
+
import { canonicalDnKey as i, compareDistinguishedNames as a, isWithinDirectoryNameSubtree as o } from "./internal/shared/dn.js";
|
|
3
|
+
import { encodeName as s, encodeRelativeDistinguishedName as c } from "./x509/name.js";
|
|
4
|
+
import { buildCertificateExtensions as l, buildRequestedExtensions as u, buildSubjectKeyIdentifier as d, encodeAuthorityInfoAccess as f, encodeBasicConstraints as p, encodeCertificatePolicies as m, encodeCrlDistributionPoints as h, encodeExtendedKeyUsage as g, encodeExtension as _, encodeInhibitAnyPolicy as v, encodeKeyUsage as y, encodeNameConstraints as b, encodePolicyConstraints as x, encodePolicyMappings as S, encodeSubjectAltName as C, getAuthorityInfoAccessMethodOid as w, getExtendedKeyUsageOid as T, parseAuthorityInfoAccessMethodOid as E, parseExtendedKeyUsageOid as D } from "./x509/extensions.js";
|
|
5
|
+
import { certificateMatchesPrivateKey as O, decodeExtension as k, decodeExtensionMap as A, decodeExtensions as j, defineExtensionDecoder as M, defineExtensionDecoderMap as N, findExtension as P, getSubjectPublicKey as F, getSubjectPublicKeyOrThrow as I, matchCertificatePrivateKey as L, parseAuthorityInfoAccess as R, parseAuthorityKeyIdentifier as z, parseBasicConstraints as B, parseCertificateChainPem as V, parseCertificateChainPemOrThrow as H, parseCertificateDer as U, parseCertificateDerOrThrow as W, parseCertificateFromSource as G, parseCertificatePem as K, parseCertificatePemOrThrow as q, parseCertificatePolicies as J, parseCertificateSigningRequestDer as Y, parseCertificateSigningRequestDerOrThrow as X, parseCertificateSigningRequestPem as Z, parseCertificateSigningRequestPemOrThrow as Q, parseCertificatesFromSource as $, parseCrlDistributionPoints as ee, parseDistinguishedNameDer as te, parseExtendedKeyUsage as ne, parseInhibitAnyPolicy as re, parseKeyUsage as ie, parseNameConstraints as ae, parsePolicyConstraints as oe, parsePolicyMappings as se, parseSubjectAltNames as ce } from "./x509/parse.js";
|
|
6
|
+
import { createCertificate as le, createSelfSignedCertificate as ue } from "./x509/certificate.js";
|
|
7
|
+
import { createCertificateSigningRequest as de } from "./x509/csr.js";
|
|
8
|
+
import { certificateFingerprint as fe } from "./x509/fingerprint.js";
|
|
9
|
+
import { distinguishedNameToString as pe, relativeDistinguishedNameToString as me, subjectAltNameLabel as he, subjectAltNameToString as ge } from "./x509/name-text.js";
|
|
10
|
+
export { e as allOnesMaskForIpAddress, l as buildCertificateExtensions, u as buildRequestedExtensions, i as canonicalDnKey, fe as certificateFingerprint, O as certificateMatchesPrivateKey, a as compareDistinguishedNames, le as createCertificate, de as createCertificateSigningRequest, ue as createSelfSignedCertificate, R as decodeAuthorityInfoAccess, z as decodeAuthorityKeyIdentifier, B as decodeBasicConstraints, J as decodeCertificatePolicies, ee as decodeCrlDistributionPoints, ne as decodeExtendedKeyUsage, k as decodeExtension, A as decodeExtensionMap, j as decodeExtensions, re as decodeInhibitAnyPolicy, t as decodeIpAddress, ie as decodeKeyUsage, ae as decodeNameConstraints, oe as decodePolicyConstraints, se as decodePolicyMappings, ce as decodeSubjectAltNames, M as defineExtensionDecoder, N as defineExtensionDecoderMap, pe as distinguishedNameToString, f as encodeAuthorityInfoAccess, p as encodeBasicConstraints, m as encodeCertificatePolicies, h as encodeCrlDistributionPoints, g as encodeExtendedKeyUsage, _ as encodeExtension, v as encodeInhibitAnyPolicy, y as encodeKeyUsage, s as encodeName, b as encodeNameConstraints, x as encodePolicyConstraints, S as encodePolicyMappings, c as encodeRelativeDistinguishedName, C as encodeSubjectAltName, P as findExtension, w as getAuthorityInfoAccessMethodOid, T as getExtendedKeyUsageOid, F as getSubjectPublicKey, I as getSubjectPublicKeyOrThrow, o as isWithinDirectoryNameSubtree, L as matchCertificatePrivateKey, n as normalizeIpAddress, E as parseAuthorityInfoAccessMethodOid, V as parseCertificateChainPem, H as parseCertificateChainPemOrThrow, U as parseCertificateDer, W as parseCertificateDerOrThrow, G as parseCertificateFromSource, K as parseCertificatePem, q as parseCertificatePemOrThrow, Y as parseCertificateSigningRequestDer, X as parseCertificateSigningRequestDerOrThrow, Z as parseCertificateSigningRequestPem, Q as parseCertificateSigningRequestPemOrThrow, $ as parseCertificatesFromSource, te as parseDistinguishedNameDer, D as parseExtendedKeyUsageOid, r as parseIpAddressToBytes, me as relativeDistinguishedNameToString, he as subjectAltNameLabel, ge as subjectAltNameToString, d as subjectKeyIdentifier };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "micro509",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "The zero-dependency TypeScript PKI toolkit for real certificate workflows.",
|
|
5
|
-
"keywords": ["x509", "certificate", "csr", "pem", "der", "jwk"],
|
|
5
|
+
"keywords": ["x509", "certificate", "csr", "pem", "der", "jwk", "importmapify"],
|
|
6
6
|
"homepage": "https://micro509.kjanat.dev",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"imports": {
|
|
20
20
|
"#micro509": "./src/index.ts",
|
|
21
21
|
"#micro509/*": "./src/*.ts",
|
|
22
|
+
"#micro509/crypto": "./src/crypto/index.ts",
|
|
23
|
+
"#micro509/der": "./src/der/index.ts",
|
|
22
24
|
"#micro509/keys": "./src/keys/index.ts",
|
|
23
25
|
"#micro509/pem": "./src/pem/index.ts",
|
|
24
26
|
"#micro509/pkcs": "./src/pkcs/index.ts",
|
|
@@ -40,6 +42,14 @@
|
|
|
40
42
|
"types": "./dist/index.d.ts",
|
|
41
43
|
"default": "./dist/index.js"
|
|
42
44
|
},
|
|
45
|
+
"./crypto": {
|
|
46
|
+
"types": "./dist/crypto.d.ts",
|
|
47
|
+
"default": "./dist/crypto.js"
|
|
48
|
+
},
|
|
49
|
+
"./der": {
|
|
50
|
+
"types": "./dist/der.d.ts",
|
|
51
|
+
"default": "./dist/der.js"
|
|
52
|
+
},
|
|
43
53
|
"./keys": {
|
|
44
54
|
"types": "./dist/keys.d.ts",
|
|
45
55
|
"default": "./dist/keys.js"
|
|
@@ -82,20 +92,25 @@
|
|
|
82
92
|
"check:biome": "biome check",
|
|
83
93
|
"check:deno": "deno check src",
|
|
84
94
|
"deno:cache": "deno cache --import-map=deno.import_map.json {src,docs,packages}/",
|
|
85
|
-
"deno:cleandocs": "rm -rf
|
|
86
|
-
"deno:
|
|
87
|
-
"
|
|
88
|
-
"
|
|
95
|
+
"deno:cleandocs": "rm -rf ./.denodocs 2>/dev/null",
|
|
96
|
+
"deno:doc": "run -qpk deno:importsmap deno:cleandocs; deno doc --import-map deno.import_map.json --no-npm --name=\"$(jq -r '.name' package.json)\"",
|
|
97
|
+
"deno:importsmap": "run importmapify --quiet --out deno.import_map.json --import 'bun:test=./node_modules/bun-types/test.d.ts' --import '@deno/doc=jsr:@deno/doc@0.199.0' --import 'vue=./node_modules/vue/dist/vue.d.ts'",
|
|
98
|
+
"dev": "run -pK build:watch site:dev",
|
|
99
|
+
"docs:build": "run -q deno:doc --html --output=.denodocs $(jq -r '.exports | .[]? // .' jsr.json) 2>/dev/null",
|
|
100
|
+
"docs:lint": "run -q deno:doc --lint $(jq -r '.exports | .[]? // .' jsr.json)",
|
|
89
101
|
"fmt": "dprint fmt",
|
|
90
|
-
"
|
|
102
|
+
"format": "run -q fmt",
|
|
103
|
+
"lint": "run -qq lint:biome",
|
|
91
104
|
"lint:biome": "biome lint",
|
|
92
105
|
"lint:deno": "deno lint src",
|
|
106
|
+
"lint:fix": "biome check --fix",
|
|
93
107
|
"playwright:chromium": "npx playwright install --with-deps chromium",
|
|
94
108
|
"prepare": "run -sq deno:importsmap deno:cache",
|
|
95
109
|
"prepublishOnly": "[ -n \"${GITHUB_ACTIONS:-}\" ] || { printf '%s\\n' 'manual npm publish blocked; use release workflow for provenance' >&2; exit 1; }",
|
|
96
|
-
"publish:jsr": "[ -n \"${GITHUB_ACTIONS:-}\" ] || { printf '%s\\n' 'manual JSR publish blocked; use release workflow' >&2; exit 1; };
|
|
97
|
-
"publish:pkgprnew": "
|
|
98
|
-
"
|
|
110
|
+
"publish:jsr": "[ -n \"${GITHUB_ACTIONS:-}\" ] || { printf '%s\\n' 'manual JSR publish blocked; use release workflow' >&2; exit 1; }; BIN=\"${BIN:-bun}\"; $BIN x jsr publish",
|
|
111
|
+
"publish:pkgprnew": "BIN=\"${BIN:-bun}\"; $BIN x pkg-pr-new publish --packageManager='npm,pnpm,bun' --bun --template './examples/vite'",
|
|
112
|
+
"rfc": "bun scripts/fetch-rfc.bun.ts",
|
|
113
|
+
"site:build": "run build; run --dir site/.vitepress build",
|
|
99
114
|
"site:dev": "run --dir site/.vitepress dev",
|
|
100
115
|
"site:import-maps": "deno run --allow-read --allow-net --allow-write --allow-run scripts/site-import-maps.deno.ts",
|
|
101
116
|
"site:live-examples": "node scripts/site-live-examples.mjs",
|
|
@@ -103,18 +118,20 @@
|
|
|
103
118
|
"site:typecheck": "run --dir site/.vitepress typecheck",
|
|
104
119
|
"smoke": "run build -l silent; run -p smoke:browser smoke:bun smoke:deno smoke:node smoke:workerd",
|
|
105
120
|
"smoke:browser": "node scripts/smoke-browser.mjs",
|
|
106
|
-
"smoke:bun": "bun --bun scripts/smoke.mjs",
|
|
121
|
+
"smoke:bun": "BIN=\"${BIN:-bun}\"; $BIN --bun scripts/smoke.mjs",
|
|
107
122
|
"smoke:deno": "deno run --allow-read scripts/smoke.mjs",
|
|
108
123
|
"smoke:node": "node scripts/smoke.mjs",
|
|
109
124
|
"smoke:workerd": "node scripts/smoke-workerd.mjs",
|
|
110
|
-
"test": "AGENT
|
|
111
|
-
"test:
|
|
112
|
-
"test:
|
|
113
|
-
"test:
|
|
125
|
+
"test": "BIN=\"${BIN:-bun}\"; AGENT=\"${AGENT:-1}\" $BIN test --concurrent",
|
|
126
|
+
"test:35433": "PR=\"35433\"; (command -v \"bun-${PR}\" >/dev/null || bunx bun-pr \"${PR}\") && BIN=\"bun-${PR}\" bun --silent run test",
|
|
127
|
+
"test:coverage": "run -q test --coverage",
|
|
128
|
+
"test:differential": "BIN=\"${BIN:-bun}\"; $BIN test test/differential.test.ts test/differential-fuzz.test.ts",
|
|
129
|
+
"test:pkits": "BIN=\"${BIN:-bun}\"; $BIN test test/pkits.test.ts",
|
|
130
|
+
"test:watch": "BIN=\"${BIN:-bun}\"; $BIN run test --watch",
|
|
114
131
|
"typecheck": "run -pk typecheck:src typecheck:other typecheck:regular site:typecheck",
|
|
115
|
-
"typecheck:other": "
|
|
116
|
-
"typecheck:regular": "
|
|
117
|
-
"typecheck:src": "
|
|
132
|
+
"typecheck:other": "run typescript-7 --noEmit -p tsconfig.other.json",
|
|
133
|
+
"typecheck:regular": "run typescript-7 --noEmit -p tsconfig.json",
|
|
134
|
+
"typecheck:src": "run typescript-7 --noEmit -p tsconfig.src.json",
|
|
118
135
|
"wrangler:build": "wrangler build",
|
|
119
136
|
"wrangler:deploy": "wrangler deploy",
|
|
120
137
|
"wrangler:deploy:versions": "wrangler versions upload",
|
|
@@ -125,15 +142,16 @@
|
|
|
125
142
|
},
|
|
126
143
|
"devDependencies": {
|
|
127
144
|
"@arethetypeswrong/core": "catalog:build",
|
|
128
|
-
"@biomejs/biome": "catalog:",
|
|
129
145
|
"@deno/doc": "catalog:deno",
|
|
130
146
|
"@micro509/doc-render": "workspace:*",
|
|
131
147
|
"@tsconfig/node24": "catalog:ts",
|
|
132
148
|
"@types/bun": "catalog:ts",
|
|
133
149
|
"@types/deno": "catalog:deno",
|
|
134
150
|
"@types/node": "catalog:ts",
|
|
151
|
+
"biome": "catalog:",
|
|
135
152
|
"deno": "catalog:deno",
|
|
136
153
|
"dprint": "catalog:",
|
|
154
|
+
"dreamcli": "npm:@kjanat/dreamcli@3.0.1",
|
|
137
155
|
"importmapify": "catalog:deno",
|
|
138
156
|
"playwright": "^1.61.1",
|
|
139
157
|
"publint": "catalog:build",
|
|
@@ -155,7 +173,7 @@
|
|
|
155
173
|
},
|
|
156
174
|
{
|
|
157
175
|
"name": "npm",
|
|
158
|
-
"version": ">=11
|
|
176
|
+
"version": ">=11 <12",
|
|
159
177
|
"onFail": "warn"
|
|
160
178
|
}
|
|
161
179
|
],
|
|
@@ -178,33 +196,33 @@
|
|
|
178
196
|
"npm": "11.18.0"
|
|
179
197
|
},
|
|
180
198
|
"catalog": {
|
|
181
|
-
"
|
|
182
|
-
"dprint": "^0.55.
|
|
183
|
-
"runner-run": "^0.
|
|
184
|
-
"vue": "^3.5.
|
|
199
|
+
"biome": "npm:@biomejs/biome@^2.5.5",
|
|
200
|
+
"dprint": "^0.55.2",
|
|
201
|
+
"runner-run": "^0.23.0",
|
|
202
|
+
"vue": "^3.5.40"
|
|
185
203
|
},
|
|
186
204
|
"catalogs": {
|
|
187
205
|
"build": {
|
|
188
206
|
"@arethetypeswrong/core": "^0.18.4",
|
|
189
|
-
"publint": "^0.3.
|
|
190
|
-
"tsdown": "^0.22.
|
|
207
|
+
"publint": "^0.3.22",
|
|
208
|
+
"tsdown": "^0.22.14",
|
|
191
209
|
"unplugin-unused": "^0.5.7"
|
|
192
210
|
},
|
|
193
211
|
"cloudflare": {
|
|
194
|
-
"@cloudflare/vite-plugin": "^1.
|
|
195
|
-
"wrangler": "^4.
|
|
212
|
+
"@cloudflare/vite-plugin": "^1.46.0",
|
|
213
|
+
"wrangler": "^4.114.0"
|
|
196
214
|
},
|
|
197
215
|
"deno": {
|
|
198
216
|
"@deno/doc": "npm:@jsr/deno__doc@0.199.0",
|
|
199
217
|
"@types/deno": "^2.7.0",
|
|
200
|
-
"deno": "^2.9.
|
|
201
|
-
"importmapify": "^1.
|
|
218
|
+
"deno": "^2.9.4",
|
|
219
|
+
"importmapify": "^1.7.0"
|
|
202
220
|
},
|
|
203
221
|
"site": {
|
|
204
222
|
"markdown-it-task-lists": "^2.1.1",
|
|
205
|
-
"tar": "^7.5.
|
|
223
|
+
"tar": "^7.5.21",
|
|
206
224
|
"vite-robots-txt": "^1.0.0",
|
|
207
|
-
"vite-svg-to-ico": "^4.
|
|
225
|
+
"vite-svg-to-ico": "^4.1.0",
|
|
208
226
|
"vitepress": "2.0.0-alpha.18"
|
|
209
227
|
},
|
|
210
228
|
"ts": {
|
|
@@ -215,8 +233,8 @@
|
|
|
215
233
|
"@types/node": "^26.1.0",
|
|
216
234
|
"@vue/tsconfig": "^0.9.1",
|
|
217
235
|
"typescript": "npm:typescript@>=6,<7",
|
|
218
|
-
"typescript-6": "npm:@typescript/typescript6@^6
|
|
219
|
-
"typescript-7": "npm:typescript
|
|
236
|
+
"typescript-6": "npm:@typescript/typescript6@^6",
|
|
237
|
+
"typescript-7": "npm:typescript@>=7",
|
|
220
238
|
"vue-tsc": "^3.3.5"
|
|
221
239
|
}
|
|
222
240
|
},
|