micro509 0.15.0 → 0.16.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 +56 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/internal/verify/spki-distrust.js +23 -0
- package/dist/internal/verify/spki-distrust.js.map +1 -0
- package/dist/internal/verify/verify-path.js +77 -60
- package/dist/internal/verify/verify-path.js.map +1 -1
- package/dist/keys/keys.d.ts +11 -8
- package/dist/keys/keys.js.map +1 -1
- package/dist/revocation/crl.js +2 -7
- package/dist/revocation/crl.js.map +1 -1
- package/dist/verify/verify.d.ts +32 -1
- package/dist/verify/verify.js +100 -58
- package/dist/verify/verify.js.map +1 -1
- package/dist/x509/fingerprint.d.ts +11 -0
- package/dist/x509/fingerprint.js +19 -1
- package/dist/x509/fingerprint.js.map +1 -1
- package/dist/x509.d.ts +2 -2
- package/dist/x509.js +3 -3
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fingerprint.js","names":["parseCertificateFromSource","certificate","digest","getCrypto","algorithm","toArrayBuffer","der","bytes","toHex","value"],"sources":["../../src/x509/fingerprint.ts"],"sourcesContent":["/**\n * Certificate fingerprints: a cryptographic hash over the DER encoding.\n *\n * This is the identifier that `openssl x509 -fingerprint` and every TLS UI show.\n * The helper accepts the same PEM / DER / parsed-certificate source union as\n * the verification APIs and returns the digest in the forms callers actually\n * paste around: raw bytes, lowercase hex, and uppercase colon-separated hex.\n *\n * @module\n */\n\nimport { toArrayBuffer, toHex } from '#micro509/internal/asn1/asn1';\nimport { getCrypto } from '#micro509/internal/crypto/webcrypto';\nimport type { ParsedCertificate } from '#micro509/x509/parse';\nimport { parseCertificateFromSource } from '#micro509/x509/parse';\n\n/**\n * A PEM string, raw DER bytes, or an already-parsed certificate.\n *\n * Mirrors the source union accepted by the verification, revocation, and\n * PKCS APIs so a fingerprint can be taken from whatever a caller already holds.\n */\nexport type CertificateFingerprintSource = string | Uint8Array | ParsedCertificate;\n\n/**\n * Digest algorithms supported by {@linkcode certificateFingerprint}.\n *\n * SHA-1 is intentionally included: legacy ecosystems (PGP-adjacent tooling,\n * older certificate pinning) still identify certificates by their SHA-1\n * fingerprint. Prefer SHA-256 for anything new.\n */\nexport type CertificateFingerprintAlgorithm = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';\n\n/** The three rendered forms of a certificate fingerprint. */\nexport interface CertificateFingerprint {\n\t/** Raw digest bytes. */\n\treadonly bytes: Uint8Array;\n\t/** Lowercase hex, no separators (e.g. `\"a1b2c3…\"`). */\n\treadonly hex: string;\n\t/** Uppercase hex, colon-separated (e.g. `\"A1:B2:C3:…\"`, `openssl x509 -fingerprint` style). */\n\treadonly colonHex: string;\n}\n\n/**\n * Compute a certificate fingerprint — a hash over the DER encoding.\n *\n * The certificate is parsed (validating the input and, for PEM, decoding it to\n * DER) before hashing, so the digest is always taken over the canonical DER of\n * a well-formed certificate. Malformed input throws, matching the other DER/PEM\n * boundaries in the library.\n *\n * **Asynchronous:** hashing uses WebCrypto's `crypto.subtle.digest`. Await the\n * returned promise before reading `bytes`, `hex`, or `colonHex`.\n *\n * @example\n * ```ts\n * const fingerprint = await certificateFingerprint(pemString);\n * console.log(fingerprint.colonHex); // \"AB:CD:…\" — matches `openssl x509 -fingerprint -sha256`\n * ```\n *\n * @example\n * ```ts\n * // Reuse an already-parsed certificate and request SHA-1.\n * const parsed = parseCertificatePemOrThrow(pemString);\n * const legacy = await certificateFingerprint(parsed, 'SHA-1');\n * console.log(legacy.hex);\n * ```\n *\n * @param certificate PEM string, DER bytes, or a {@linkcode ParsedCertificate}.\n * @param algorithm Digest algorithm to use. Defaults to `'SHA-256'`.\n */\nexport async function certificateFingerprint(\n\tcertificate: CertificateFingerprintSource,\n\talgorithm: CertificateFingerprintAlgorithm = 'SHA-256',\n): Promise<CertificateFingerprint> {\n\tconst { der } = parseCertificateFromSource(certificate);\n\tconst digest = await getCrypto().subtle.digest(algorithm, toArrayBuffer(der));\n\tconst bytes = new Uint8Array(digest);\n\treturn {\n\t\tbytes,\n\t\thex: toHex(bytes),\n\t\tcolonHex: toColonHex(bytes),\n\t};\n}\n\n/** Renders bytes as uppercase, colon-separated hex (openssl fingerprint style). */\nfunction toColonHex(bytes: Uint8Array): string {\n\treturn Array.from(bytes, (value) => value.toString(16).padStart(2, '0').toUpperCase()).join(':');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,eAAsB,uBACrB,GACA,IAA6C,WACX;CAClC,IAAM,EAAE,WAAQA,EAA2BC,CAAW,GAChDC,IAAS,MAAMC,EAAU,CAAC,CAAC,OAAO,OAAOC,GAAWC,EAAcC,CAAG,CAAC,GACtEC,IAAQ,IAAI,WAAWL,CAAM;CACnC,OAAO;EACN;EACA,KAAKM,EAAMD,CAAK;EAChB,UAAU,WAAWA,CAAK;CAC3B;AACD;;AAGA,SAAS,WAAW,GAA2B;CAC9C,OAAO,MAAM,KAAKA,IAAQ,
|
|
1
|
+
{"version":3,"file":"fingerprint.js","names":["parseCertificateFromSource","certificate","digest","getCrypto","algorithm","toArrayBuffer","der","bytes","toHex","source","parsed","value"],"sources":["../../src/x509/fingerprint.ts"],"sourcesContent":["/**\n * Certificate fingerprints: a cryptographic hash over the DER encoding.\n *\n * This is the identifier that `openssl x509 -fingerprint` and every TLS UI show.\n * The helper accepts the same PEM / DER / parsed-certificate source union as\n * the verification APIs and returns the digest in the forms callers actually\n * paste around: raw bytes, lowercase hex, and uppercase colon-separated hex.\n *\n * @module\n */\n\nimport { toArrayBuffer, toHex } from '#micro509/internal/asn1/asn1';\nimport { getCrypto } from '#micro509/internal/crypto/webcrypto';\nimport type { ParsedCertificate } from '#micro509/x509/parse';\nimport { parseCertificateFromSource } from '#micro509/x509/parse';\n\n/**\n * A PEM string, raw DER bytes, or an already-parsed certificate.\n *\n * Mirrors the source union accepted by the verification, revocation, and\n * PKCS APIs so a fingerprint can be taken from whatever a caller already holds.\n */\nexport type CertificateFingerprintSource = string | Uint8Array | ParsedCertificate;\n\n/**\n * Digest algorithms supported by {@linkcode certificateFingerprint}.\n *\n * SHA-1 is intentionally included: legacy ecosystems (PGP-adjacent tooling,\n * older certificate pinning) still identify certificates by their SHA-1\n * fingerprint. Prefer SHA-256 for anything new.\n */\nexport type CertificateFingerprintAlgorithm = 'SHA-1' | 'SHA-256' | 'SHA-384' | 'SHA-512';\n\n/** The three rendered forms of a certificate fingerprint. */\nexport interface CertificateFingerprint {\n\t/** Raw digest bytes. */\n\treadonly bytes: Uint8Array;\n\t/** Lowercase hex, no separators (e.g. `\"a1b2c3…\"`). */\n\treadonly hex: string;\n\t/** Uppercase hex, colon-separated (e.g. `\"A1:B2:C3:…\"`, `openssl x509 -fingerprint` style). */\n\treadonly colonHex: string;\n}\n\n/**\n * Compute a certificate fingerprint — a hash over the DER encoding.\n *\n * The certificate is parsed (validating the input and, for PEM, decoding it to\n * DER) before hashing, so the digest is always taken over the canonical DER of\n * a well-formed certificate. Malformed input throws, matching the other DER/PEM\n * boundaries in the library.\n *\n * **Asynchronous:** hashing uses WebCrypto's `crypto.subtle.digest`. Await the\n * returned promise before reading `bytes`, `hex`, or `colonHex`.\n *\n * @example\n * ```ts\n * const fingerprint = await certificateFingerprint(pemString);\n * console.log(fingerprint.colonHex); // \"AB:CD:…\" — matches `openssl x509 -fingerprint -sha256`\n * ```\n *\n * @example\n * ```ts\n * // Reuse an already-parsed certificate and request SHA-1.\n * const parsed = parseCertificatePemOrThrow(pemString);\n * const legacy = await certificateFingerprint(parsed, 'SHA-1');\n * console.log(legacy.hex);\n * ```\n *\n * @param certificate PEM string, DER bytes, or a {@linkcode ParsedCertificate}.\n * @param algorithm Digest algorithm to use. Defaults to `'SHA-256'`.\n */\nexport async function certificateFingerprint(\n\tcertificate: CertificateFingerprintSource,\n\talgorithm: CertificateFingerprintAlgorithm = 'SHA-256',\n): Promise<CertificateFingerprint> {\n\tconst { der } = parseCertificateFromSource(certificate);\n\tconst digest = await getCrypto().subtle.digest(algorithm, toArrayBuffer(der));\n\tconst bytes = new Uint8Array(digest);\n\treturn {\n\t\tbytes,\n\t\thex: toHex(bytes),\n\t\tcolonHex: toColonHex(bytes),\n\t};\n}\n\n/**\n * Compute the SHA-256 fingerprint of a certificate's complete DER\n * SubjectPublicKeyInfo. Unlike {@linkcode certificateFingerprint}, this\n * identifies the public key rather than the certificate. Cross-signed\n * certificates carrying the same SPKI therefore have the same fingerprint.\n *\n * The SPKI is read from the reparsed certificate DER. No cryptographic key\n * import is performed, so this works for algorithms micro509 cannot use with\n * WebCrypto.\n */\nexport async function subjectPublicKeyInfoFingerprint(\n\tcertificate: CertificateFingerprintSource,\n): Promise<CertificateFingerprint> {\n\tconst source =\n\t\ttypeof certificate === 'string' || certificate instanceof Uint8Array\n\t\t\t? certificate\n\t\t\t: certificate.der;\n\tconst parsed = parseCertificateFromSource(source);\n\tconst digest = await getCrypto().subtle.digest(\n\t\t'SHA-256',\n\t\ttoArrayBuffer(parsed.subjectPublicKeyInfoDer),\n\t);\n\tconst bytes = new Uint8Array(digest);\n\treturn { bytes, hex: toHex(bytes), colonHex: toColonHex(bytes) };\n}\n\n/** Renders bytes as uppercase, colon-separated hex (openssl fingerprint style). */\nfunction toColonHex(bytes: Uint8Array): string {\n\treturn Array.from(bytes, (value) => value.toString(16).padStart(2, '0').toUpperCase()).join(':');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,eAAsB,uBACrB,GACA,IAA6C,WACX;CAClC,IAAM,EAAE,WAAQA,EAA2BC,CAAW,GAChDC,IAAS,MAAMC,EAAU,CAAC,CAAC,OAAO,OAAOC,GAAWC,EAAcC,CAAG,CAAC,GACtEC,IAAQ,IAAI,WAAWL,CAAM;CACnC,OAAO;EACN;EACA,KAAKM,EAAMD,CAAK;EAChB,UAAU,WAAWA,CAAK;CAC3B;AACD;;;;;;;;;;;AAYA,eAAsB,gCACrB,GACkC;CAClC,IAAME,IACL,OAAOR,KAAgB,YAAYA,aAAuB,aACvDA,IACAA,EAAY,KACVS,IAASV,EAA2BS,CAAM,GAC1CP,IAAS,MAAMC,EAAU,CAAC,CAAC,OAAO,OACvC,WACAE,EAAcK,EAAO,uBAAuB,CAC7C,GACMH,IAAQ,IAAI,WAAWL,CAAM;CACnC,OAAO;EAAE;EAAO,KAAKM,EAAMD,CAAK;EAAG,UAAU,WAAWA,CAAK;CAAE;AAChE;;AAGA,SAAS,WAAW,GAA2B;CAC9C,OAAO,MAAM,KAAKA,IAAQ,MAAUI,EAAM,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,GAAG;AAChG"}
|
package/dist/x509.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ import { AuthorityInfoAccessMethod, AuthorityInformationAccess, AuthorityInforma
|
|
|
7
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
8
|
import { CertificateMaterial, CreateCertificateErrorCode, CreateCertificateInput, CreateSelfSignedCertificateBase, CreateSelfSignedCertificateInput, SelfSignedCertificateResult, SelfSignedKeySource, ValidityInput, createCertificate, createSelfSignedCertificate } from "./x509/certificate.js";
|
|
9
9
|
import { CreateCsrInput, CsrMaterial, createCertificateSigningRequest } from "./x509/csr.js";
|
|
10
|
-
import { CertificateFingerprint, CertificateFingerprintAlgorithm, CertificateFingerprintSource, certificateFingerprint } from "./x509/fingerprint.js";
|
|
10
|
+
import { CertificateFingerprint, CertificateFingerprintAlgorithm, CertificateFingerprintSource, certificateFingerprint, subjectPublicKeyInfoFingerprint } from "./x509/fingerprint.js";
|
|
11
11
|
import { SubjectAltNameTextOptions, distinguishedNameToString, relativeDistinguishedNameToString, subjectAltNameLabel, subjectAltNameToString } from "./x509/name-text.js";
|
|
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 DisplayTextType, 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 OversizedDisplayText, 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 };
|
|
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 DisplayTextType, 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 OversizedDisplayText, 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, subjectPublicKeyInfoFingerprint };
|
package/dist/x509.js
CHANGED
|
@@ -5,6 +5,6 @@ import { buildCertificateExtensions as l, buildRequestedExtensions as u, buildSu
|
|
|
5
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
6
|
import { createCertificate as le, createSelfSignedCertificate as ue } from "./x509/certificate.js";
|
|
7
7
|
import { createCertificateSigningRequest as de } from "./x509/csr.js";
|
|
8
|
-
import { certificateFingerprint as fe } from "./x509/fingerprint.js";
|
|
9
|
-
import { distinguishedNameToString as
|
|
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,
|
|
8
|
+
import { certificateFingerprint as fe, subjectPublicKeyInfoFingerprint as pe } from "./x509/fingerprint.js";
|
|
9
|
+
import { distinguishedNameToString as me, relativeDistinguishedNameToString as he, subjectAltNameLabel as ge, subjectAltNameToString as _e } 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, me 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, he as relativeDistinguishedNameToString, ge as subjectAltNameLabel, _e as subjectAltNameToString, d as subjectKeyIdentifier, pe as subjectPublicKeyInfoFingerprint };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "micro509",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "The zero-dependency TypeScript PKI toolkit for real certificate workflows.",
|
|
5
5
|
"keywords": ["x509", "certificate", "csr", "pem", "der", "jwk", "importmapify"],
|
|
6
6
|
"homepage": "https://micro509.kjanat.dev",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"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",
|
|
105
105
|
"publish:pkgprnew": "BIN=\"${BIN:-bun}\"; $BIN x pkg-pr-new publish --packageManager=bun --bun --template './examples/vite' --template './examples/tsc-compat' . ./tsc/protocol ./tsc/bridge ./tsc/wasm ./tsc/compat ./tsc/vue-mapper",
|
|
106
106
|
"rfc": "bun scripts/fetch-spec.bun.ts rfc",
|
|
107
|
-
"site:build": "
|
|
107
|
+
"site:build": "node scripts/site-build.mjs",
|
|
108
108
|
"site:import-maps": "deno run --allow-read --allow-net --allow-write --allow-run scripts/site-import-maps.deno.ts",
|
|
109
109
|
"site:live-examples": "node scripts/site-live-examples.mjs",
|
|
110
110
|
"smoke": "run build -l silent; run -p smoke:browser smoke:bun smoke:deno smoke:node smoke:workerd",
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
"typescript-7": "npm:typescript@>=7"
|
|
253
253
|
},
|
|
254
254
|
"ts7": {
|
|
255
|
-
"typescript": "npm:typescript@7.1.0-dev.
|
|
255
|
+
"typescript": "npm:typescript@7.1.0-dev.20261024.1"
|
|
256
256
|
}
|
|
257
257
|
},
|
|
258
258
|
"trustedDependencies": ["deno", "dprint", "esbuild", "sharp", "workerd"]
|