@peculiar/certificates-viewer 3.2.0 → 3.3.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/dist/cjs/{certification_request-cde57123.js → certification_request-e1997ebf.js} +563 -133
- package/dist/cjs/crl-f1ee43bc.js +312 -0
- package/dist/cjs/{index-ff818d4d.js → download-a97f4cb2.js} +106 -2
- package/dist/cjs/index.cjs.js +1 -3
- package/dist/cjs/l10n-638a7577.js +167 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{peculiar-attribute-certificate-viewer_2.cjs.entry.js → peculiar-attribute-certificate-viewer_3.cjs.entry.js} +123 -21
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -15
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +2 -2
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +6 -25
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -8
- package/dist/cjs/peculiar.cjs.js +1 -1
- package/dist/cjs/{public_key-e56dbe52.js → public_key-ba538d77.js} +80 -40
- package/dist/cjs/{x509_certificate-51a97033.js → x509_certificate-42b478d2.js} +13 -7
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +19 -6
- package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +2 -1
- package/dist/collection/components/certificate-viewer/basic_information.js +3 -1
- package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +2 -1
- package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +2 -1
- package/dist/collection/components/certificate-viewer/extensions/crl_number_extension.js +19 -0
- package/dist/collection/components/certificate-viewer/extensions/index.js +9 -1
- package/dist/collection/components/certificate-viewer/extensions/issuing_distribution_point_extension.js +27 -0
- package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +2 -1
- package/dist/collection/components/certificate-viewer/miscellaneous.js +2 -20
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +2 -3
- package/dist/collection/components/crl-viewer/crl-viewer.js +234 -0
- package/dist/collection/components/crl-viewer/revoked_certificates.js +27 -0
- package/dist/collection/crypto/crl.js +82 -0
- package/dist/collection/crypto/csr.js +7 -0
- package/dist/collection/crypto/extension.js +10 -1
- package/dist/collection/crypto/index.js +1 -0
- package/dist/collection/crypto/x509_attribute_certificate.js +7 -1
- package/dist/collection/crypto/x509_certificate.js +7 -1
- package/dist/collection/locales/en.json +12 -1
- package/dist/collection/utils/download.js +18 -2
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/validator.js +2 -0
- package/dist/esm/{certification_request-c0674647.js → certification_request-5d982d92.js} +493 -66
- package/dist/esm/crl-f2110716.js +308 -0
- package/dist/esm/{index-0ba131b0.js → download-67ac9120.js} +102 -2
- package/dist/esm/index.js +1 -3
- package/dist/esm/{l10n-ac28fa92.js → l10n-da0dd100.js} +24 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{peculiar-attribute-certificate-viewer_2.entry.js → peculiar-attribute-certificate-viewer_3.entry.js} +113 -12
- package/dist/esm/peculiar-certificate-decoder.entry.js +21 -11
- package/dist/esm/peculiar-certificate-summary_3.entry.js +2 -2
- package/dist/esm/peculiar-certificate-viewer.entry.js +6 -25
- package/dist/esm/peculiar-certificates-viewer.entry.js +6 -8
- package/dist/esm/peculiar.js +1 -1
- package/dist/esm/{public_key-43b2cbf0.js → public_key-0a3091a5.js} +67 -28
- package/dist/esm/{x509_certificate-12f6d344.js → x509_certificate-6b243207.js} +9 -3
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/locales/en.json +12 -1
- package/dist/peculiar/p-34e2d6be.entry.js +11 -0
- package/dist/peculiar/p-35e7a514.js +12 -0
- package/dist/peculiar/p-3aea9dde.js +32 -0
- package/dist/peculiar/{p-38635919.entry.js → p-49ab6f8c.entry.js} +1 -1
- package/dist/peculiar/p-86116b1f.entry.js +4 -0
- package/dist/peculiar/{p-464e0943.js → p-bce2bbe0.js} +9 -9
- package/dist/peculiar/p-ca0c34ca.entry.js +26 -0
- package/dist/peculiar/p-cff9655c.js +18 -0
- package/dist/peculiar/{p-17c4da7b.js → p-db6e24c6.js} +2 -2
- package/dist/peculiar/p-e535a666.entry.js +4 -0
- package/dist/peculiar/p-f8dc3232.js +63 -0
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +3 -3
- package/dist/types/components/certificate-viewer/basic_information.d.ts +2 -0
- package/dist/types/components/certificate-viewer/extensions/crl_number_extension.d.ts +15 -0
- package/dist/types/components/certificate-viewer/extensions/issuing_distribution_point_extension.d.ts +15 -0
- package/dist/types/components/certificate-viewer/miscellaneous.d.ts +2 -2
- package/dist/types/components/certificate-viewer/row.d.ts +1 -1
- package/dist/types/components/crl-viewer/crl-viewer.d.ts +59 -0
- package/dist/types/components/crl-viewer/revoked_certificates.d.ts +14 -0
- package/dist/types/components.d.ts +66 -0
- package/dist/types/crypto/crl.d.ts +28 -0
- package/dist/types/crypto/csr.d.ts +2 -0
- package/dist/types/crypto/extension.d.ts +2 -2
- package/dist/types/crypto/index.d.ts +1 -0
- package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -0
- package/dist/types/crypto/x509_certificate.d.ts +2 -0
- package/dist/types/utils/download.d.ts +10 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/l10n.d.ts +11 -0
- package/dist/types/utils/validator.d.ts +1 -0
- package/package.json +19 -19
- package/dist/cjs/_commonjsHelpers-cb1f949a.js +0 -23
- package/dist/cjs/csr-78378ed0.js +0 -150
- package/dist/cjs/download-6724f3a7.js +0 -79
- package/dist/cjs/l10n-a048a686.js +0 -145
- package/dist/cjs/x509_attribute_certificate-cc325b70.js +0 -87
- package/dist/esm/_commonjsHelpers-bfbd2ad8.js +0 -20
- package/dist/esm/csr-c1b6a176.js +0 -147
- package/dist/esm/download-735fb2eb.js +0 -76
- package/dist/esm/x509_attribute_certificate-a6d4aa15.js +0 -85
- package/dist/peculiar/p-006865d7.js +0 -4
- package/dist/peculiar/p-1ebab45c.js +0 -78
- package/dist/peculiar/p-3f8d1008.entry.js +0 -4
- package/dist/peculiar/p-42da7f97.js +0 -11
- package/dist/peculiar/p-4f4c1d30.js +0 -12
- package/dist/peculiar/p-530afe84.entry.js +0 -11
- package/dist/peculiar/p-6011646e.entry.js +0 -11
- package/dist/peculiar/p-6c510523.js +0 -18
- package/dist/peculiar/p-d0b55fbb.js +0 -4
- package/dist/peculiar/p-d7a13cb4.js +0 -18
- package/dist/peculiar/p-e77d0ccc.entry.js +0 -18
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
import { Extension as AsnExtension, AuthorityInfoAccessSyntax, AuthorityKeyIdentifier, BasicConstraints, CertificateIssuer, CertificatePolicies, CRLDistributionPoints, CRLReason, ExtendedKeyUsage, InhibitAnyPolicy, InvalidityDate, KeyUsage, NameConstraints, PolicyConstraints, PolicyMappings, SubjectDirectoryAttributes, SubjectKeyIdentifier, PrivateKeyUsagePeriod, EntrustVersionInfo, SubjectInfoAccessSyntax } from '@peculiar/asn1-x509';
|
|
8
|
+
import { Extension as AsnExtension, AuthorityInfoAccessSyntax, AuthorityKeyIdentifier, BasicConstraints, CertificateIssuer, CertificatePolicies, CRLDistributionPoints, IssuingDistributionPoint, CRLReason, ExtendedKeyUsage, InhibitAnyPolicy, InvalidityDate, KeyUsage, NameConstraints, PolicyConstraints, PolicyMappings, SubjectDirectoryAttributes, SubjectKeyIdentifier, PrivateKeyUsagePeriod, EntrustVersionInfo, SubjectInfoAccessSyntax, CRLNumber, BaseCRLNumber } from '@peculiar/asn1-x509';
|
|
9
9
|
import { QCStatements, BiometricSyntax } from '@peculiar/asn1-x509-qualified';
|
|
10
10
|
import { CertificateTemplate, EnrollCertTypeChoice, CaVersion } from '@peculiar/asn1-x509-microsoft';
|
|
11
11
|
import { NetscapeComment, NetscapeCertType } from '@peculiar/asn1-x509-netscape';
|
|
@@ -15,7 +15,7 @@ import { Timestamp, ArchiveRevInfo } from '@peculiar/asn1-adobe-acrobat';
|
|
|
15
15
|
import { LogotypeExtn } from '@peculiar/asn1-x509-logotype';
|
|
16
16
|
import { TNAuthorizationList } from '@peculiar/asn1-rfc8226';
|
|
17
17
|
import { AsnData } from './asn_data';
|
|
18
|
-
export declare type TExtensionValue = AuthorityInfoAccessSyntax | AuthorityKeyIdentifier | BasicConstraints | CertificateIssuer | CertificatePolicies | CRLDistributionPoints | CRLReason | ExtendedKeyUsage | InhibitAnyPolicy | InvalidityDate | NameConstraints | PolicyConstraints | PolicyMappings | SubjectDirectoryAttributes | SubjectKeyIdentifier | QCStatements | CertificateTemplate | EnrollCertTypeChoice | NetscapeComment | LeiChoice | LeiRole | CertificateTransparency | Timestamp | ArchiveRevInfo | KeyUsage | NetscapeCertType | CaVersion | PrivateKeyUsagePeriod | EntrustVersionInfo | BiometricSyntax | LogotypeExtn | TNAuthorizationList | SubjectInfoAccessSyntax | string;
|
|
18
|
+
export declare type TExtensionValue = AuthorityInfoAccessSyntax | AuthorityKeyIdentifier | BasicConstraints | CertificateIssuer | CertificatePolicies | CRLDistributionPoints | IssuingDistributionPoint | CRLReason | ExtendedKeyUsage | InhibitAnyPolicy | InvalidityDate | NameConstraints | PolicyConstraints | PolicyMappings | SubjectDirectoryAttributes | SubjectKeyIdentifier | QCStatements | CertificateTemplate | EnrollCertTypeChoice | NetscapeComment | LeiChoice | LeiRole | CertificateTransparency | Timestamp | ArchiveRevInfo | KeyUsage | NetscapeCertType | CaVersion | PrivateKeyUsagePeriod | EntrustVersionInfo | BiometricSyntax | LogotypeExtn | TNAuthorizationList | SubjectInfoAccessSyntax | CRLNumber | BaseCRLNumber | string;
|
|
19
19
|
export declare class Extension<T extends TExtensionValue> extends AsnData<AsnExtension> {
|
|
20
20
|
readonly value: T;
|
|
21
21
|
private getAsnExtnValue;
|
|
@@ -35,5 +35,7 @@ export declare class X509AttributeCertificate extends AsnData<AttributeCertifica
|
|
|
35
35
|
exportAsHexFormatted(): string;
|
|
36
36
|
exportAsPemFormatted(): string;
|
|
37
37
|
get commonName(): string;
|
|
38
|
+
downloadAsPEM(name?: string): void;
|
|
39
|
+
downloadAsDER(name?: string): void;
|
|
38
40
|
}
|
|
39
41
|
export {};
|
|
@@ -6,11 +6,19 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
export declare class Download {
|
|
9
|
-
static
|
|
9
|
+
static cert: {
|
|
10
10
|
asPEM: (pem: string, name: string) => void;
|
|
11
11
|
asDER: (hex: string, name: string) => void;
|
|
12
12
|
};
|
|
13
|
-
static
|
|
13
|
+
static attrCert: {
|
|
14
|
+
asPEM: (pem: string, name: string) => void;
|
|
15
|
+
asDER: (hex: string, name: string) => void;
|
|
16
|
+
};
|
|
17
|
+
static csr: {
|
|
18
|
+
asPEM: (pem: string, name: string) => void;
|
|
19
|
+
asDER: (hex: string, name: string) => void;
|
|
20
|
+
};
|
|
21
|
+
static crl: {
|
|
14
22
|
asPEM: (pem: string, name: string) => void;
|
|
15
23
|
asDER: (hex: string, name: string) => void;
|
|
16
24
|
};
|
|
@@ -27,6 +27,8 @@ declare const MESSAGES_ALL: {
|
|
|
27
27
|
validity: string;
|
|
28
28
|
issued: string;
|
|
29
29
|
expired: string;
|
|
30
|
+
lastUpdate: string;
|
|
31
|
+
nextUpdate: string;
|
|
30
32
|
algorithm: string;
|
|
31
33
|
namedCurve: string;
|
|
32
34
|
exponent: string;
|
|
@@ -46,6 +48,15 @@ declare const MESSAGES_ALL: {
|
|
|
46
48
|
holder: string;
|
|
47
49
|
digestInfo: string;
|
|
48
50
|
type: string;
|
|
51
|
+
revokedCertificates: string;
|
|
52
|
+
revocation: string;
|
|
53
|
+
yes: string;
|
|
54
|
+
no: string;
|
|
55
|
+
onlyUserCertificates: string;
|
|
56
|
+
onlyAttributeCertificates: string;
|
|
57
|
+
onlyCACertificates: string;
|
|
58
|
+
indirectCRL: string;
|
|
59
|
+
onlyReasons: string;
|
|
49
60
|
};
|
|
50
61
|
};
|
|
51
62
|
export declare type SupportedMessagesType = keyof typeof MESSAGES_ALL;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export declare const isHex: (value: string) => boolean;
|
|
9
9
|
export declare const isPem: (value: string) => boolean;
|
|
10
10
|
export declare const isX509Pem: (value: string) => boolean;
|
|
11
|
+
export declare const isX509CRLPem: (value: string) => boolean;
|
|
11
12
|
export declare const isPkcs10Pem: (value: string) => boolean;
|
|
12
13
|
export declare const isX509AttributePem: (value: string) => boolean;
|
|
13
14
|
export declare const isBase64: (value: string) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peculiar/certificates-viewer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Peculiar Certificate Viewer web-components makes it easy for you to display certificate related details in your web application.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
"typescript": "^4.0.5"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@peculiar/asn1-adobe-acrobat": "^2.
|
|
45
|
-
"@peculiar/asn1-cert-transparency": "^2.
|
|
46
|
-
"@peculiar/asn1-csr": "^2.
|
|
47
|
-
"@peculiar/asn1-ecc": "^2.
|
|
48
|
-
"@peculiar/asn1-lei": "^2.
|
|
49
|
-
"@peculiar/asn1-ntqwac": "^2.
|
|
50
|
-
"@peculiar/asn1-pkcs9": "^2.
|
|
51
|
-
"@peculiar/asn1-rfc8226": "^2.
|
|
52
|
-
"@peculiar/asn1-rsa": "^2.
|
|
53
|
-
"@peculiar/asn1-schema": "^2.
|
|
54
|
-
"@peculiar/asn1-x509": "^2.
|
|
55
|
-
"@peculiar/asn1-x509-attr": "^2.
|
|
56
|
-
"@peculiar/asn1-x509-logotype": "^2.
|
|
57
|
-
"@peculiar/asn1-x509-microsoft": "^2.
|
|
58
|
-
"@peculiar/asn1-x509-netscape": "^2.
|
|
59
|
-
"@peculiar/asn1-x509-qualified": "^2.
|
|
60
|
-
"dayjs": "^1.11.
|
|
44
|
+
"@peculiar/asn1-adobe-acrobat": "^2.3.2",
|
|
45
|
+
"@peculiar/asn1-cert-transparency": "^2.3.0",
|
|
46
|
+
"@peculiar/asn1-csr": "^2.3.2",
|
|
47
|
+
"@peculiar/asn1-ecc": "^2.3.2",
|
|
48
|
+
"@peculiar/asn1-lei": "^2.3.0",
|
|
49
|
+
"@peculiar/asn1-ntqwac": "^2.3.2",
|
|
50
|
+
"@peculiar/asn1-pkcs9": "^2.3.2",
|
|
51
|
+
"@peculiar/asn1-rfc8226": "^2.3.0",
|
|
52
|
+
"@peculiar/asn1-rsa": "^2.3.2",
|
|
53
|
+
"@peculiar/asn1-schema": "^2.3.0",
|
|
54
|
+
"@peculiar/asn1-x509": "^2.3.2",
|
|
55
|
+
"@peculiar/asn1-x509-attr": "^2.3.2",
|
|
56
|
+
"@peculiar/asn1-x509-logotype": "^2.3.2",
|
|
57
|
+
"@peculiar/asn1-x509-microsoft": "^2.3.2",
|
|
58
|
+
"@peculiar/asn1-x509-netscape": "^2.3.0",
|
|
59
|
+
"@peculiar/asn1-x509-qualified": "^2.3.2",
|
|
60
|
+
"dayjs": "^1.11.5",
|
|
61
61
|
"pvtsutils": "^1.3.2"
|
|
62
62
|
},
|
|
63
63
|
"license": "MIT",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "248246a5fbd056f2dcb41b603b3858e1681d7951"
|
|
74
74
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
7
|
-
|
|
8
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
9
|
-
return module = {
|
|
10
|
-
path: basedir,
|
|
11
|
-
exports: {},
|
|
12
|
-
require: function (path, base) {
|
|
13
|
-
return commonjsRequire();
|
|
14
|
-
}
|
|
15
|
-
}, fn(module, module.exports), module.exports;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function commonjsRequire () {
|
|
19
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.commonjsGlobal = commonjsGlobal;
|
|
23
|
-
exports.createCommonjsModule = createCommonjsModule;
|
package/dist/cjs/csr-78378ed0.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
const certification_request = require('./certification_request-cde57123.js');
|
|
7
|
-
const index = require('./index-ff818d4d.js');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the MIT license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/
|
|
16
|
-
class Attribute extends certification_request.AsnData {
|
|
17
|
-
constructor(raw) {
|
|
18
|
-
super(raw, certification_request.Attribute);
|
|
19
|
-
const asnExtnValue = this.getAsnExtnValue();
|
|
20
|
-
switch (this.asn.type) {
|
|
21
|
-
case certification_request.id_DomainNameBeneficiary:
|
|
22
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameBeneficiary);
|
|
23
|
-
break;
|
|
24
|
-
case certification_request.id_DomainNameLegalRepresentative:
|
|
25
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameLegalRepresentative);
|
|
26
|
-
break;
|
|
27
|
-
case certification_request.id_DomainNameOwner:
|
|
28
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameOwner);
|
|
29
|
-
break;
|
|
30
|
-
case certification_request.id_DomainNameTechnicalOperator:
|
|
31
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameTechnicalOperator);
|
|
32
|
-
break;
|
|
33
|
-
case certification_request.id_TypeRelationship:
|
|
34
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.TypeRelationship);
|
|
35
|
-
break;
|
|
36
|
-
case certification_request.id_ActivityDescription:
|
|
37
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ActivityDescription);
|
|
38
|
-
break;
|
|
39
|
-
case certification_request.id_WebGDPR:
|
|
40
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.WebGDPR);
|
|
41
|
-
break;
|
|
42
|
-
case certification_request.id_InsuranceValue:
|
|
43
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.InsuranceValue);
|
|
44
|
-
break;
|
|
45
|
-
case certification_request.id_ValuationRanking:
|
|
46
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ValuationRanking);
|
|
47
|
-
break;
|
|
48
|
-
case certification_request.id_pkcs9_at_challengePassword:
|
|
49
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ChallengePassword);
|
|
50
|
-
break;
|
|
51
|
-
case certification_request.id_pkcs9_at_unstructuredName:
|
|
52
|
-
this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.UnstructuredName);
|
|
53
|
-
break;
|
|
54
|
-
case certification_request.id_pkcs9_at_extensionRequest: {
|
|
55
|
-
const extensionRequest = certification_request.AsnParser.parse(asnExtnValue, certification_request.ExtensionRequest);
|
|
56
|
-
this.value = extensionRequest
|
|
57
|
-
.map((e) => new certification_request.Extension(certification_request.AsnConvert.serialize(e)));
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
default:
|
|
61
|
-
this.value = index.build.Convert.ToHex(asnExtnValue);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
getAsnExtnValue() {
|
|
65
|
-
return this.asn.values[0];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* @license
|
|
71
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the MIT license found in the
|
|
74
|
-
* LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/
|
|
76
|
-
class CSR extends certification_request.AsnData {
|
|
77
|
-
constructor(raw) {
|
|
78
|
-
super(certification_request.certificateRawToBuffer(raw), certification_request.CertificationRequest);
|
|
79
|
-
this.thumbprints = {};
|
|
80
|
-
this.type = 'PKCS#10 Certificate Request';
|
|
81
|
-
const { certificationRequestInfo } = this.asn;
|
|
82
|
-
this.subject = new certification_request.Name(certificationRequestInfo.subject).toJSON();
|
|
83
|
-
this.version = certificationRequestInfo.version;
|
|
84
|
-
}
|
|
85
|
-
get publicKey() {
|
|
86
|
-
const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;
|
|
87
|
-
let params;
|
|
88
|
-
if (algorithm.algorithm === certification_request.id_ecPublicKey && algorithm.parameters) {
|
|
89
|
-
params = certification_request.AsnConvert.parse(algorithm.parameters, certification_request.ECParameters);
|
|
90
|
-
}
|
|
91
|
-
if (algorithm.algorithm === certification_request.id_rsaEncryption) {
|
|
92
|
-
params = certification_request.AsnConvert.parse(subjectPublicKey, certification_request.RSAPublicKey);
|
|
93
|
-
}
|
|
94
|
-
const spki = certification_request.AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);
|
|
95
|
-
return {
|
|
96
|
-
params,
|
|
97
|
-
value: spki,
|
|
98
|
-
algorithm: algorithm.algorithm,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
get signature() {
|
|
102
|
-
const { signature, signatureAlgorithm } = this.asn;
|
|
103
|
-
return {
|
|
104
|
-
value: signature,
|
|
105
|
-
algorithm: signatureAlgorithm.algorithm,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
get commonName() {
|
|
109
|
-
if (!this.subject) {
|
|
110
|
-
return '';
|
|
111
|
-
}
|
|
112
|
-
for (let i = 0; i < this.subject.length; i += 1) {
|
|
113
|
-
const name = this.subject[i];
|
|
114
|
-
if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
|
|
115
|
-
return name.value;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return '';
|
|
119
|
-
}
|
|
120
|
-
async getThumbprint(algorithm = 'SHA-1') {
|
|
121
|
-
try {
|
|
122
|
-
const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
|
|
123
|
-
if (thumbprint) {
|
|
124
|
-
this.thumbprints[algorithm['name'] || algorithm] = index.build.Convert.ToHex(thumbprint);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
console.error('Error thumbprint get:', error);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
parseAttributes() {
|
|
132
|
-
const { certificationRequestInfo } = this.asn;
|
|
133
|
-
if (certificationRequestInfo.attributes) {
|
|
134
|
-
this.attributes = certificationRequestInfo.attributes
|
|
135
|
-
.map((e) => new Attribute(certification_request.AsnConvert.serialize(e)));
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exportAsBase64() {
|
|
139
|
-
return index.build.Convert.ToBase64(this.raw);
|
|
140
|
-
}
|
|
141
|
-
exportAsHexFormatted() {
|
|
142
|
-
return certification_request.hexFormat(index.build.Convert.ToHex(this.raw));
|
|
143
|
-
}
|
|
144
|
-
exportAsPemFormatted() {
|
|
145
|
-
return `-----BEGIN CERTIFICATE REQUEST-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
exports.Attribute = Attribute;
|
|
150
|
-
exports.CSR = CSR;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
const index = require('./index-ff818d4d.js');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @license
|
|
10
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the MIT license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Download from buffer
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```js
|
|
20
|
-
* import { downloadFromBuffer } from './utils';
|
|
21
|
-
*
|
|
22
|
-
* downloadFromBuffer(arrayBufferValue, 'myFile', 'pdf', 'applciation/pdf');
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
function downloadFromBuffer(value, name, extension, mime = 'application/octet-stream') {
|
|
26
|
-
const blob = new Blob([value], { type: mime });
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
navigator.msSaveBlob(blob, `${name}.${extension}`);
|
|
31
|
-
return new Promise((res) => setTimeout(res, 100));
|
|
32
|
-
}
|
|
33
|
-
const blobURL = window.URL.createObjectURL(blob);
|
|
34
|
-
const link = document.createElement('a');
|
|
35
|
-
const frame = document.createElement('iframe');
|
|
36
|
-
link.style.display = 'none';
|
|
37
|
-
frame.style.display = 'none';
|
|
38
|
-
frame.name = blobURL;
|
|
39
|
-
document.body.appendChild(frame);
|
|
40
|
-
link.href = blobURL;
|
|
41
|
-
link.target = blobURL;
|
|
42
|
-
link.download = `${name}.${extension}`;
|
|
43
|
-
document.body.appendChild(link);
|
|
44
|
-
link.dispatchEvent(new MouseEvent('click'));
|
|
45
|
-
document.body.removeChild(link);
|
|
46
|
-
return new Promise((res) => setTimeout(() => {
|
|
47
|
-
document.body.removeChild(frame);
|
|
48
|
-
res(undefined);
|
|
49
|
-
}, 100));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @license
|
|
54
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the MIT license found in the
|
|
57
|
-
* LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/
|
|
59
|
-
class Download {
|
|
60
|
-
}
|
|
61
|
-
Download.x509 = {
|
|
62
|
-
asPEM: (pem, name) => {
|
|
63
|
-
downloadFromBuffer(index.build.Convert.FromString(pem), name, 'cer', 'application/pkix-cert');
|
|
64
|
-
},
|
|
65
|
-
asDER: (hex, name) => {
|
|
66
|
-
downloadFromBuffer(index.build.Convert.FromString(hex), name, 'cer', 'application/pkix-cert');
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
Download.pkcs10 = {
|
|
70
|
-
asPEM: (pem, name) => {
|
|
71
|
-
downloadFromBuffer(index.build.Convert.FromString(pem), name, 'csr', 'application/pkcs10');
|
|
72
|
-
},
|
|
73
|
-
asDER: (hex, name) => {
|
|
74
|
-
downloadFromBuffer(index.build.Convert.FromString(hex), name, 'csr', 'application/pkcs10');
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
exports.Download = Download;
|
|
79
|
-
exports.downloadFromBuffer = downloadFromBuffer;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
const _commonjsHelpers = require('./_commonjsHelpers-cb1f949a.js');
|
|
7
|
-
|
|
8
|
-
var dayjs_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
9
|
-
!function(t,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
var relativeTime = _commonjsHelpers.createCommonjsModule(function (module, exports) {
|
|
13
|
-
!function(r,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @license
|
|
18
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the MIT license found in the
|
|
21
|
-
* LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/
|
|
23
|
-
dayjs_min.extend(relativeTime);
|
|
24
|
-
const dateShort = (date) => (new Date(date).toUTCString());
|
|
25
|
-
const dateDiff = (dateStart, dateEnd) => {
|
|
26
|
-
if (!dateStart || !dateEnd) {
|
|
27
|
-
return '';
|
|
28
|
-
}
|
|
29
|
-
const start = dayjs_min(dateStart);
|
|
30
|
-
const end = dayjs_min(dateEnd);
|
|
31
|
-
return start.to(end, true);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const basicInformation = "Basic Information";
|
|
35
|
-
const subjectName = "Subject Name";
|
|
36
|
-
const issuerName = "Issuer Name";
|
|
37
|
-
const publicKeyInfo = "Public Key Info";
|
|
38
|
-
const signature = "Signature";
|
|
39
|
-
const extensions = "Extensions";
|
|
40
|
-
const miscellaneous = "Miscellaneous";
|
|
41
|
-
const download = "Download";
|
|
42
|
-
const serialNumber = "Serial Number";
|
|
43
|
-
const version = "Version";
|
|
44
|
-
const validity = "Validity";
|
|
45
|
-
const issued = "Issued";
|
|
46
|
-
const expired = "Expired";
|
|
47
|
-
const algorithm = "Algorithm";
|
|
48
|
-
const namedCurve = "Named Curve";
|
|
49
|
-
const exponent = "Exponent";
|
|
50
|
-
const modulus = "Modulus";
|
|
51
|
-
const value = "Value";
|
|
52
|
-
const valid = "Valid";
|
|
53
|
-
const revoked = "Revoked";
|
|
54
|
-
const issuer = "Issuer";
|
|
55
|
-
const name = "Name";
|
|
56
|
-
const publicKey = "Public Key";
|
|
57
|
-
const fingerprint = "Fingerprint";
|
|
58
|
-
const fingerprints = "Fingerprints";
|
|
59
|
-
const actions = "Actions";
|
|
60
|
-
const details = "Details";
|
|
61
|
-
const testURLs = "Test URLs";
|
|
62
|
-
const certificateDetails = "Certificate Details";
|
|
63
|
-
const holder = "Holder";
|
|
64
|
-
const digestInfo = "Digest Info";
|
|
65
|
-
const type = "Type";
|
|
66
|
-
const en = {
|
|
67
|
-
basicInformation: basicInformation,
|
|
68
|
-
subjectName: subjectName,
|
|
69
|
-
issuerName: issuerName,
|
|
70
|
-
publicKeyInfo: publicKeyInfo,
|
|
71
|
-
signature: signature,
|
|
72
|
-
extensions: extensions,
|
|
73
|
-
miscellaneous: miscellaneous,
|
|
74
|
-
download: download,
|
|
75
|
-
"download.pem": "Download PEM",
|
|
76
|
-
"download.der": "Download DER",
|
|
77
|
-
serialNumber: serialNumber,
|
|
78
|
-
version: version,
|
|
79
|
-
validity: validity,
|
|
80
|
-
issued: issued,
|
|
81
|
-
expired: expired,
|
|
82
|
-
algorithm: algorithm,
|
|
83
|
-
namedCurve: namedCurve,
|
|
84
|
-
exponent: exponent,
|
|
85
|
-
modulus: modulus,
|
|
86
|
-
value: value,
|
|
87
|
-
valid: valid,
|
|
88
|
-
revoked: revoked,
|
|
89
|
-
issuer: issuer,
|
|
90
|
-
name: name,
|
|
91
|
-
publicKey: publicKey,
|
|
92
|
-
fingerprint: fingerprint,
|
|
93
|
-
fingerprints: fingerprints,
|
|
94
|
-
actions: actions,
|
|
95
|
-
details: details,
|
|
96
|
-
testURLs: testURLs,
|
|
97
|
-
certificateDetails: certificateDetails,
|
|
98
|
-
holder: holder,
|
|
99
|
-
digestInfo: digestInfo,
|
|
100
|
-
type: type
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @license
|
|
105
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the MIT license found in the
|
|
108
|
-
* LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/
|
|
110
|
-
const MESSAGES_ALL = {
|
|
111
|
-
en,
|
|
112
|
-
};
|
|
113
|
-
class Localization {
|
|
114
|
-
constructor() {
|
|
115
|
-
this.setLocale = (locale) => {
|
|
116
|
-
this.locale = locale && MESSAGES_ALL[locale] ? locale : 'en';
|
|
117
|
-
};
|
|
118
|
-
this.getLocale = () => this.locale;
|
|
119
|
-
const language = window.navigator.language.slice(0, 2).toLowerCase();
|
|
120
|
-
this.setLocale(language);
|
|
121
|
-
}
|
|
122
|
-
getString(id, replacer) {
|
|
123
|
-
const value = MESSAGES_ALL[this.locale][id];
|
|
124
|
-
if (!value) {
|
|
125
|
-
return '';
|
|
126
|
-
}
|
|
127
|
-
if (!replacer) {
|
|
128
|
-
return value;
|
|
129
|
-
}
|
|
130
|
-
const splitted = value.split(replacer.pattern);
|
|
131
|
-
if (splitted.length > 1) {
|
|
132
|
-
return [
|
|
133
|
-
splitted[0],
|
|
134
|
-
replacer.replacer,
|
|
135
|
-
splitted[1],
|
|
136
|
-
];
|
|
137
|
-
}
|
|
138
|
-
return value;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const l10n = new Localization();
|
|
142
|
-
|
|
143
|
-
exports.dateDiff = dateDiff;
|
|
144
|
-
exports.dateShort = dateShort;
|
|
145
|
-
exports.l10n = l10n;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
const certification_request = require('./certification_request-cde57123.js');
|
|
7
|
-
const index = require('./index-ff818d4d.js');
|
|
8
|
-
const l10n = require('./l10n-a048a686.js');
|
|
9
|
-
const csr = require('./csr-78378ed0.js');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @license
|
|
13
|
-
* Copyright (c) Peculiar Ventures, LLC.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/
|
|
18
|
-
class X509AttributeCertificate extends certification_request.AsnData {
|
|
19
|
-
constructor(raw) {
|
|
20
|
-
var _a;
|
|
21
|
-
super(certification_request.certificateRawToBuffer(raw), certification_request.AttributeCertificate);
|
|
22
|
-
this.thumbprints = {};
|
|
23
|
-
this.type = 'X.509 Attribute Certificate';
|
|
24
|
-
const { acinfo } = this.asn;
|
|
25
|
-
this.serialNumber = index.build.Convert.ToHex(acinfo.serialNumber);
|
|
26
|
-
this.version = acinfo.version;
|
|
27
|
-
const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
|
|
28
|
-
if (!notBefore) {
|
|
29
|
-
throw new Error("Cannot get 'notBefore' value");
|
|
30
|
-
}
|
|
31
|
-
this.notBefore = notBefore;
|
|
32
|
-
const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
|
|
33
|
-
if (!notAfter) {
|
|
34
|
-
throw new Error("Cannot get 'notAfter' value");
|
|
35
|
-
}
|
|
36
|
-
this.notAfter = notAfter;
|
|
37
|
-
this.validity = l10n.dateDiff(this.notBefore, this.notAfter);
|
|
38
|
-
this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
|
|
39
|
-
this.holder = acinfo.holder;
|
|
40
|
-
}
|
|
41
|
-
get signature() {
|
|
42
|
-
const { signatureValue, signatureAlgorithm } = this.asn;
|
|
43
|
-
return {
|
|
44
|
-
value: signatureValue,
|
|
45
|
-
algorithm: signatureAlgorithm.algorithm,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
parseExtensions() {
|
|
49
|
-
const { acinfo } = this.asn;
|
|
50
|
-
if (acinfo.extensions) {
|
|
51
|
-
this.extensions = acinfo.extensions
|
|
52
|
-
.map((e) => new certification_request.Extension(certification_request.AsnConvert.serialize(e)));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
parseAttributes() {
|
|
56
|
-
const { acinfo } = this.asn;
|
|
57
|
-
if (acinfo.attributes) {
|
|
58
|
-
this.attributes = acinfo.attributes
|
|
59
|
-
.map((e) => new csr.Attribute(certification_request.AsnConvert.serialize(e)));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async getThumbprint(algorithm = 'SHA-1') {
|
|
63
|
-
try {
|
|
64
|
-
const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
|
|
65
|
-
if (thumbprint) {
|
|
66
|
-
this.thumbprints[algorithm['name'] || algorithm] = index.build.Convert.ToHex(thumbprint);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
console.error('Error thumbprint get:', error);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
exportAsBase64() {
|
|
74
|
-
return index.build.Convert.ToBase64(this.raw);
|
|
75
|
-
}
|
|
76
|
-
exportAsHexFormatted() {
|
|
77
|
-
return certification_request.hexFormat(index.build.Convert.ToHex(this.raw));
|
|
78
|
-
}
|
|
79
|
-
exportAsPemFormatted() {
|
|
80
|
-
return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
|
|
81
|
-
}
|
|
82
|
-
get commonName() {
|
|
83
|
-
return `attribute-certificate-${this.thumbprints['SHA-1']}`;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
exports.X509AttributeCertificate = X509AttributeCertificate;
|