node-opcua-crypto 1.11.0 → 2.0.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/.fossa.yml +18 -18
- package/.github/FUNDING.yml +12 -12
- package/.github/workflows/main.yml +32 -32
- package/.prettierrc.js +6 -6
- package/LICENSE +23 -22
- package/README.md +14 -14
- package/dist/source/asn1.d.ts +73 -73
- package/dist/source/asn1.js +359 -359
- package/dist/source/buffer_utils.d.ts +6 -6
- package/dist/source/buffer_utils.js +21 -21
- package/dist/source/certificate_matches_private_key.d.ts +2 -0
- package/dist/source/certificate_matches_private_key.js +22 -0
- package/dist/source/certificate_matches_private_key.js.map +1 -0
- package/dist/source/common.d.ts +12 -12
- package/dist/source/common.js +2 -2
- package/dist/source/crypto_explore_certificate.d.ts +107 -107
- package/dist/source/crypto_explore_certificate.js +601 -600
- package/dist/source/crypto_explore_certificate.js.map +1 -1
- package/dist/source/crypto_utils.d.ts +80 -78
- package/dist/source/crypto_utils.js +312 -280
- package/dist/source/crypto_utils.js.map +1 -1
- package/dist/source/derived_keys.d.ts +72 -72
- package/dist/source/derived_keys.js +248 -248
- package/dist/source/explore_certificate.d.ts +30 -30
- package/dist/source/explore_certificate.js +43 -43
- package/dist/source/explore_certificate_revocation_list.d.ts +28 -28
- package/dist/source/explore_certificate_revocation_list.js +69 -69
- package/dist/source/explore_certificate_signing_request.d.ts +13 -13
- package/dist/source/explore_certificate_signing_request.js +44 -44
- package/dist/source/explore_private_key.d.ts +29 -29
- package/dist/source/explore_private_key.js +96 -96
- package/dist/source/explore_private_key.js.map +1 -1
- package/dist/source/index.d.ts +13 -13
- package/dist/source/index.js +29 -29
- package/dist/source/oid_map.d.ts +7 -7
- package/dist/source/oid_map.js +303 -303
- package/dist/source/public_private_match.d.ts +3 -3
- package/dist/source/public_private_match.js +37 -16
- package/dist/source/public_private_match.js.map +1 -1
- package/dist/source/verify_certificate_signature.d.ts +10 -10
- package/dist/source/verify_certificate_signature.js +101 -101
- package/dist/source_nodejs/index.d.ts +3 -3
- package/dist/source_nodejs/index.js +19 -19
- package/dist/source_nodejs/read.d.ts +29 -29
- package/dist/source_nodejs/read.js +94 -94
- package/dist/source_nodejs/read.js.map +1 -1
- package/dist/source_nodejs/read_certificate_revocation_list.d.ts +2 -2
- package/dist/source_nodejs/read_certificate_revocation_list.js +27 -27
- package/dist/source_nodejs/read_certificate_signing_request.d.ts +3 -3
- package/dist/source_nodejs/read_certificate_signing_request.js +27 -27
- package/index.d.ts +2 -2
- package/index.js +4 -4
- package/index_web.js +3 -3
- package/package.json +12 -12
- package/source/asn1.ts +404 -404
- package/source/buffer_utils.ts +18 -18
- package/source/common.ts +13 -13
- package/source/crypto_explore_certificate.ts +764 -763
- package/source/crypto_utils.ts +359 -321
- package/source/derived_keys.ts +287 -287
- package/source/explore_certificate.ts +66 -66
- package/source/explore_certificate_revocation_list.ts +122 -122
- package/source/explore_certificate_signing_request.ts +58 -58
- package/source/explore_private_key.ts +121 -121
- package/source/index.ts +13 -13
- package/source/oid_map.ts +310 -310
- package/source/public_private_match.ts +41 -18
- package/source/verify_certificate_signature.ts +105 -105
- package/source_nodejs/index.ts +2 -2
- package/source_nodejs/read.ts +95 -95
- package/source_nodejs/read_certificate_revocation_list.ts +14 -14
- package/source_nodejs/read_certificate_signing_request.ts +17 -17
- package/test_certificate.ts +34 -34
- package/tsconfig.json +18 -18
- package/tslint.json +34 -34
- package/dist/asn1.d.ts +0 -69
- package/dist/asn1.js +0 -349
- package/dist/asn1.js.map +0 -1
- package/dist/buffer_utils.d.ts +0 -6
- package/dist/buffer_utils.js +0 -22
- package/dist/buffer_utils.js.map +0 -1
- package/dist/common.d.ts +0 -11
- package/dist/common.js +0 -3
- package/dist/common.js.map +0 -1
- package/dist/crypto_explore_certificate.d.ts +0 -95
- package/dist/crypto_explore_certificate.js +0 -547
- package/dist/crypto_explore_certificate.js.map +0 -1
- package/dist/crypto_utils.d.ts +0 -106
- package/dist/crypto_utils.js +0 -370
- package/dist/crypto_utils.js.map +0 -1
- package/dist/derived_keys.d.ts +0 -72
- package/dist/derived_keys.js +0 -247
- package/dist/derived_keys.js.map +0 -1
- package/dist/explore_certificate.d.ts +0 -30
- package/dist/explore_certificate.js +0 -44
- package/dist/explore_certificate.js.map +0 -1
- package/dist/explore_certificate_revocation_list.d.ts +0 -30
- package/dist/explore_certificate_revocation_list.js +0 -67
- package/dist/explore_certificate_revocation_list.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
- package/dist/oid_map.d.ts +0 -7
- package/dist/oid_map.js +0 -262
- package/dist/oid_map.js.map +0 -1
- package/dist/verify_cerficate_signature.d.ts +0 -10
- package/dist/verify_cerficate_signature.js +0 -102
- package/dist/verify_cerficate_signature.js.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Certificate } from "./common";
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
1
|
+
import { Certificate, PrivateKey } from "./common";
|
|
2
|
+
export declare function publicKeyAndPrivateKeyMatches(certificate: Certificate, privateKey: PrivateKey): boolean;
|
|
3
|
+
export declare function certificateMatchesPrivateKey(certificate: Certificate, privateKey: PrivateKey): boolean;
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.publicKeyAndPrivateKeyMatches = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.certificateMatchesPrivateKey = exports.publicKeyAndPrivateKeyMatches = void 0;
|
|
4
|
+
const explore_private_key_1 = require("./explore_private_key");
|
|
5
|
+
const crypto_utils_1 = require("./crypto_utils");
|
|
6
|
+
const crypto_explore_certificate_1 = require("./crypto_explore_certificate");
|
|
7
|
+
function publicKeyAndPrivateKeyMatches(certificate, privateKey) {
|
|
8
|
+
const i = (0, crypto_explore_certificate_1.exploreCertificate)(certificate);
|
|
9
|
+
const j = (0, explore_private_key_1.explorePrivateKey)(privateKey);
|
|
10
|
+
const modulus1 = i.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey.modulus;
|
|
11
|
+
const modulus2 = j.modulus;
|
|
12
|
+
if (modulus1.length != modulus2.length) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return modulus1.toString("hex") === modulus2.toString("hex");
|
|
16
|
+
}
|
|
17
|
+
exports.publicKeyAndPrivateKeyMatches = publicKeyAndPrivateKeyMatches;
|
|
18
|
+
/**
|
|
19
|
+
* check that the given certificate matches the given private key
|
|
20
|
+
* @param certificate
|
|
21
|
+
* @param privateKey
|
|
22
|
+
*/
|
|
23
|
+
function certificateMatchesPrivateKeyPEM(certificate, privateKey, blockSize) {
|
|
24
|
+
const initialBuffer = Buffer.from("Lorem Ipsum");
|
|
25
|
+
const encryptedBuffer = (0, crypto_utils_1.publicEncrypt_long)(initialBuffer, certificate, blockSize, 11);
|
|
26
|
+
const decryptedBuffer = (0, crypto_utils_1.privateDecrypt_long)(encryptedBuffer, privateKey, blockSize);
|
|
27
|
+
const finalString = decryptedBuffer.toString("utf-8");
|
|
28
|
+
return initialBuffer.toString("utf-8") === finalString;
|
|
29
|
+
}
|
|
30
|
+
function certificateMatchesPrivateKey(certificate, privateKey) {
|
|
31
|
+
const e = (0, explore_private_key_1.explorePrivateKey)(privateKey);
|
|
32
|
+
const blockSize = e.modulus.length;
|
|
33
|
+
const certificatePEM = (0, crypto_utils_1.toPem)(certificate, "CERTIFICATE");
|
|
34
|
+
const privateKeyPEM = (0, crypto_utils_1.toPem)(privateKey, "RSA PRIVATE KEY");
|
|
35
|
+
return certificateMatchesPrivateKeyPEM(certificatePEM, privateKeyPEM, blockSize);
|
|
36
|
+
}
|
|
37
|
+
exports.certificateMatchesPrivateKey = certificateMatchesPrivateKey;
|
|
17
38
|
//# sourceMappingURL=public_private_match.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_private_match.js","sourceRoot":"","sources":["../../source/public_private_match.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"public_private_match.js","sourceRoot":"","sources":["../../source/public_private_match.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE1D,iDAAgF;AAChF,6EAAkE;AAElE,SAAiB,6BAA6B,CAAC,WAAwB,EAAC,UAAsB;IAE1F,MAAM,CAAC,GAAG,IAAA,+CAAkB,EAAC,WAAW,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,IAAA,uCAAiB,EAAC,UAAU,CAAC,CAAC;IAExC,MAAM,QAAQ,GAAG,CAAC,CAAC,cAAc,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,OAAO,CAAC;IAChF,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC;IAE3B,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,EAAE;QACpC,OAAO,KAAK,CAAC;KAChB;IACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAZD,sEAYC;AAID;;;;GAIG;AACH,SAAS,+BAA+B,CAAC,WAA2B,EAAE,UAAyB,EAAE,SAAiB;IAC9G,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjD,MAAM,eAAe,GAAG,IAAA,iCAAkB,EAAC,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IACtF,MAAM,eAAe,GAAG,IAAA,kCAAmB,EAAC,eAAe,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACpF,MAAM,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACtD,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC;AAC3D,CAAC;AAED,SAAgB,4BAA4B,CAAC,WAAwB,EAAE,UAAsB;IACzF,MAAM,CAAC,GAAG,IAAA,uCAAiB,EAAC,UAAU,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACnC,MAAM,cAAc,GAAG,IAAA,oBAAK,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACzD,MAAM,aAAa,GAAG,IAAA,oBAAK,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IAC3D,OAAO,+BAA+B,CAAC,cAAc,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;AACrF,CAAC;AAND,oEAMC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Certificate } from "./common";
|
|
3
|
-
export declare function verifyCertificateOrClrSignature(certificateOrCrl: Buffer, parentCertificate: Certificate): boolean;
|
|
4
|
-
export declare function verifyCertificateSignature(certificate: Certificate, parentCertificate: Certificate): boolean;
|
|
5
|
-
export declare function verifyCertificateRevocationListSignature(certificateRevocationList: Certificate, parentCertificate: Certificate): boolean;
|
|
6
|
-
export
|
|
7
|
-
export declare function verifyCertificateChain(certificateChain: Certificate[]): Promise<{
|
|
8
|
-
status: _VerifyStatus;
|
|
9
|
-
reason: string;
|
|
10
|
-
}>;
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Certificate } from "./common";
|
|
3
|
+
export declare function verifyCertificateOrClrSignature(certificateOrCrl: Buffer, parentCertificate: Certificate): boolean;
|
|
4
|
+
export declare function verifyCertificateSignature(certificate: Certificate, parentCertificate: Certificate): boolean;
|
|
5
|
+
export declare function verifyCertificateRevocationListSignature(certificateRevocationList: Certificate, parentCertificate: Certificate): boolean;
|
|
6
|
+
export type _VerifyStatus = "BadCertificateIssuerUseNotAllowed" | "BadCertificateInvalid" | "Good";
|
|
7
|
+
export declare function verifyCertificateChain(certificateChain: Certificate[]): Promise<{
|
|
8
|
+
status: _VerifyStatus;
|
|
9
|
+
reason: string;
|
|
10
|
+
}>;
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// tslint:disable: no-console
|
|
3
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.verifyCertificateChain = exports.verifyCertificateRevocationListSignature = exports.verifyCertificateSignature = exports.verifyCertificateOrClrSignature = void 0;
|
|
14
|
-
// Now that we got a hash of the original certificate,
|
|
15
|
-
// we need to verify if we can obtain the same hash by using the same hashing function
|
|
16
|
-
// (in this case SHA-384). In order to do that, we need to extract just the body of
|
|
17
|
-
// the signed certificate. Which, in our case, is everything but the signature.
|
|
18
|
-
// The start of the body is always the first digit of the second line of the following command:
|
|
19
|
-
const crypto = require("crypto");
|
|
20
|
-
const crypto_explore_certificate_1 = require("./crypto_explore_certificate");
|
|
21
|
-
const crypto_utils_1 = require("./crypto_utils");
|
|
22
|
-
const asn1_1 = require("./asn1");
|
|
23
|
-
function verifyCertificateOrClrSignature(certificateOrCrl, parentCertificate) {
|
|
24
|
-
const block_info = (0, asn1_1.readTag)(certificateOrCrl, 0);
|
|
25
|
-
const blocks = (0, asn1_1._readStruct)(certificateOrCrl, block_info);
|
|
26
|
-
const bufferToBeSigned = certificateOrCrl.slice(block_info.position, blocks[1].position - 2);
|
|
27
|
-
//xx console.log("bufferToBeSigned = ", bufferToBeSigned.length, bufferToBeSigned.toString("hex").substr(0, 50), bufferToBeSigned.toString("hex").substr(-10));
|
|
28
|
-
const signatureAlgorithm = (0, asn1_1._readAlgorithmIdentifier)(certificateOrCrl, blocks[1]);
|
|
29
|
-
const signatureValue = (0, asn1_1._readSignatureValueBin)(certificateOrCrl, blocks[2]);
|
|
30
|
-
const p = (0, crypto_explore_certificate_1.split_der)(parentCertificate)[0];
|
|
31
|
-
//xx const publicKey = extractPublicKeyFromCertificateSync(p);
|
|
32
|
-
const certPem = (0, crypto_utils_1.toPem)(p, "CERTIFICATE");
|
|
33
|
-
const verify = crypto.createVerify(signatureAlgorithm.identifier);
|
|
34
|
-
verify.update(bufferToBeSigned);
|
|
35
|
-
verify.end();
|
|
36
|
-
return verify.verify(certPem, signatureValue);
|
|
37
|
-
}
|
|
38
|
-
exports.verifyCertificateOrClrSignature = verifyCertificateOrClrSignature;
|
|
39
|
-
function verifyCertificateSignature(certificate, parentCertificate) {
|
|
40
|
-
return verifyCertificateOrClrSignature(certificate, parentCertificate);
|
|
41
|
-
}
|
|
42
|
-
exports.verifyCertificateSignature = verifyCertificateSignature;
|
|
43
|
-
function verifyCertificateRevocationListSignature(certificateRevocationList, parentCertificate) {
|
|
44
|
-
return verifyCertificateOrClrSignature(certificateRevocationList, parentCertificate);
|
|
45
|
-
}
|
|
46
|
-
exports.verifyCertificateRevocationListSignature = verifyCertificateRevocationListSignature;
|
|
47
|
-
function verifyCertificateChain(certificateChain) {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
// verify that all the certificate
|
|
50
|
-
// second certificate must be used for CertificateSign
|
|
51
|
-
for (let index = 1; index < certificateChain.length; index++) {
|
|
52
|
-
const cert = certificateChain[index - 1];
|
|
53
|
-
const certParent = certificateChain[index];
|
|
54
|
-
// parent child must have keyCertSign
|
|
55
|
-
const certParentInfo = (0, crypto_explore_certificate_1.exploreCertificate)(certParent);
|
|
56
|
-
const keyUsage = certParentInfo.tbsCertificate.extensions.keyUsage;
|
|
57
|
-
// istanbul ignore next
|
|
58
|
-
if (!keyUsage.keyCertSign) {
|
|
59
|
-
return {
|
|
60
|
-
status: "BadCertificateIssuerUseNotAllowed",
|
|
61
|
-
reason: "One of the certificate in the chain has not keyUsage set for Certificate Signing",
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const parentSignChild = verifyCertificateSignature(cert, certParent);
|
|
65
|
-
if (!parentSignChild) {
|
|
66
|
-
return {
|
|
67
|
-
status: "BadCertificateInvalid",
|
|
68
|
-
reason: "One of the certificate in the chain is not signing the previous certificate",
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
const certInfo = (0, crypto_explore_certificate_1.exploreCertificate)(cert);
|
|
72
|
-
// istanbul ignore next
|
|
73
|
-
if (!certInfo.tbsCertificate.extensions) {
|
|
74
|
-
return {
|
|
75
|
-
status: "BadCertificateInvalid",
|
|
76
|
-
reason: "Cannot find X409 Extension 3 in certificate",
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
// istanbul ignore next
|
|
80
|
-
if (!certParentInfo.tbsCertificate.extensions || !certInfo.tbsCertificate.extensions.authorityKeyIdentifier) {
|
|
81
|
-
return {
|
|
82
|
-
status: "BadCertificateInvalid",
|
|
83
|
-
reason: "Cannot find X409 Extension 3 in certificate (parent)",
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
// istanbul ignore next
|
|
87
|
-
if (certParentInfo.tbsCertificate.extensions.subjectKeyIdentifier !==
|
|
88
|
-
certInfo.tbsCertificate.extensions.authorityKeyIdentifier.keyIdentifier) {
|
|
89
|
-
return {
|
|
90
|
-
status: "BadCertificateInvalid",
|
|
91
|
-
reason: "subjectKeyIdentifier authorityKeyIdentifier in child certificate do not match subjectKeyIdentifier of parent certificate",
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return {
|
|
96
|
-
status: "Good",
|
|
97
|
-
reason: `certificate chain is valid(length = ${certificateChain.length})`,
|
|
98
|
-
};
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
exports.verifyCertificateChain = verifyCertificateChain;
|
|
1
|
+
"use strict";
|
|
2
|
+
// tslint:disable: no-console
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.verifyCertificateChain = exports.verifyCertificateRevocationListSignature = exports.verifyCertificateSignature = exports.verifyCertificateOrClrSignature = void 0;
|
|
14
|
+
// Now that we got a hash of the original certificate,
|
|
15
|
+
// we need to verify if we can obtain the same hash by using the same hashing function
|
|
16
|
+
// (in this case SHA-384). In order to do that, we need to extract just the body of
|
|
17
|
+
// the signed certificate. Which, in our case, is everything but the signature.
|
|
18
|
+
// The start of the body is always the first digit of the second line of the following command:
|
|
19
|
+
const crypto = require("crypto");
|
|
20
|
+
const crypto_explore_certificate_1 = require("./crypto_explore_certificate");
|
|
21
|
+
const crypto_utils_1 = require("./crypto_utils");
|
|
22
|
+
const asn1_1 = require("./asn1");
|
|
23
|
+
function verifyCertificateOrClrSignature(certificateOrCrl, parentCertificate) {
|
|
24
|
+
const block_info = (0, asn1_1.readTag)(certificateOrCrl, 0);
|
|
25
|
+
const blocks = (0, asn1_1._readStruct)(certificateOrCrl, block_info);
|
|
26
|
+
const bufferToBeSigned = certificateOrCrl.slice(block_info.position, blocks[1].position - 2);
|
|
27
|
+
//xx console.log("bufferToBeSigned = ", bufferToBeSigned.length, bufferToBeSigned.toString("hex").substr(0, 50), bufferToBeSigned.toString("hex").substr(-10));
|
|
28
|
+
const signatureAlgorithm = (0, asn1_1._readAlgorithmIdentifier)(certificateOrCrl, blocks[1]);
|
|
29
|
+
const signatureValue = (0, asn1_1._readSignatureValueBin)(certificateOrCrl, blocks[2]);
|
|
30
|
+
const p = (0, crypto_explore_certificate_1.split_der)(parentCertificate)[0];
|
|
31
|
+
//xx const publicKey = extractPublicKeyFromCertificateSync(p);
|
|
32
|
+
const certPem = (0, crypto_utils_1.toPem)(p, "CERTIFICATE");
|
|
33
|
+
const verify = crypto.createVerify(signatureAlgorithm.identifier);
|
|
34
|
+
verify.update(bufferToBeSigned);
|
|
35
|
+
verify.end();
|
|
36
|
+
return verify.verify(certPem, signatureValue);
|
|
37
|
+
}
|
|
38
|
+
exports.verifyCertificateOrClrSignature = verifyCertificateOrClrSignature;
|
|
39
|
+
function verifyCertificateSignature(certificate, parentCertificate) {
|
|
40
|
+
return verifyCertificateOrClrSignature(certificate, parentCertificate);
|
|
41
|
+
}
|
|
42
|
+
exports.verifyCertificateSignature = verifyCertificateSignature;
|
|
43
|
+
function verifyCertificateRevocationListSignature(certificateRevocationList, parentCertificate) {
|
|
44
|
+
return verifyCertificateOrClrSignature(certificateRevocationList, parentCertificate);
|
|
45
|
+
}
|
|
46
|
+
exports.verifyCertificateRevocationListSignature = verifyCertificateRevocationListSignature;
|
|
47
|
+
function verifyCertificateChain(certificateChain) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
// verify that all the certificate
|
|
50
|
+
// second certificate must be used for CertificateSign
|
|
51
|
+
for (let index = 1; index < certificateChain.length; index++) {
|
|
52
|
+
const cert = certificateChain[index - 1];
|
|
53
|
+
const certParent = certificateChain[index];
|
|
54
|
+
// parent child must have keyCertSign
|
|
55
|
+
const certParentInfo = (0, crypto_explore_certificate_1.exploreCertificate)(certParent);
|
|
56
|
+
const keyUsage = certParentInfo.tbsCertificate.extensions.keyUsage;
|
|
57
|
+
// istanbul ignore next
|
|
58
|
+
if (!keyUsage.keyCertSign) {
|
|
59
|
+
return {
|
|
60
|
+
status: "BadCertificateIssuerUseNotAllowed",
|
|
61
|
+
reason: "One of the certificate in the chain has not keyUsage set for Certificate Signing",
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
const parentSignChild = verifyCertificateSignature(cert, certParent);
|
|
65
|
+
if (!parentSignChild) {
|
|
66
|
+
return {
|
|
67
|
+
status: "BadCertificateInvalid",
|
|
68
|
+
reason: "One of the certificate in the chain is not signing the previous certificate",
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const certInfo = (0, crypto_explore_certificate_1.exploreCertificate)(cert);
|
|
72
|
+
// istanbul ignore next
|
|
73
|
+
if (!certInfo.tbsCertificate.extensions) {
|
|
74
|
+
return {
|
|
75
|
+
status: "BadCertificateInvalid",
|
|
76
|
+
reason: "Cannot find X409 Extension 3 in certificate",
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// istanbul ignore next
|
|
80
|
+
if (!certParentInfo.tbsCertificate.extensions || !certInfo.tbsCertificate.extensions.authorityKeyIdentifier) {
|
|
81
|
+
return {
|
|
82
|
+
status: "BadCertificateInvalid",
|
|
83
|
+
reason: "Cannot find X409 Extension 3 in certificate (parent)",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// istanbul ignore next
|
|
87
|
+
if (certParentInfo.tbsCertificate.extensions.subjectKeyIdentifier !==
|
|
88
|
+
certInfo.tbsCertificate.extensions.authorityKeyIdentifier.keyIdentifier) {
|
|
89
|
+
return {
|
|
90
|
+
status: "BadCertificateInvalid",
|
|
91
|
+
reason: "subjectKeyIdentifier authorityKeyIdentifier in child certificate do not match subjectKeyIdentifier of parent certificate",
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
status: "Good",
|
|
97
|
+
reason: `certificate chain is valid(length = ${certificateChain.length})`,
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
exports.verifyCertificateChain = verifyCertificateChain;
|
|
102
102
|
//# sourceMappingURL=verify_certificate_signature.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./read";
|
|
2
|
-
export * from "./read_certificate_revocation_list";
|
|
3
|
-
export * from "./read_certificate_signing_request";
|
|
1
|
+
export * from "./read";
|
|
2
|
+
export * from "./read_certificate_revocation_list";
|
|
3
|
+
export * from "./read_certificate_signing_request";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./read"), exports);
|
|
18
|
-
__exportStar(require("./read_certificate_revocation_list"), exports);
|
|
19
|
-
__exportStar(require("./read_certificate_signing_request"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./read"), exports);
|
|
18
|
+
__exportStar(require("./read_certificate_revocation_list"), exports);
|
|
19
|
+
__exportStar(require("./read_certificate_signing_request"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Certificate, CertificatePEM, PrivateKey, PrivateKeyPEM, PublicKey, PublicKeyPEM } from "../source/common";
|
|
2
|
-
/**
|
|
3
|
-
* @method readKeyPem
|
|
4
|
-
* @param filename
|
|
5
|
-
*/
|
|
6
|
-
export declare function readKeyPem(filename: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* read a DER or PEM certificate from file
|
|
9
|
-
*/
|
|
10
|
-
export declare function readCertificate(filename: string): Certificate;
|
|
11
|
-
/**
|
|
12
|
-
* read a DER or PEM certificate from file
|
|
13
|
-
*/
|
|
14
|
-
export declare function readPublicKey(filename: string): PublicKey;
|
|
15
|
-
/**
|
|
16
|
-
* read a DER or PEM certificate from file
|
|
17
|
-
*/
|
|
18
|
-
export declare function readPrivateKey(filename: string): PrivateKey;
|
|
19
|
-
export declare function readCertificatePEM(filename: string): CertificatePEM;
|
|
20
|
-
export declare function readPublicKeyPEM(filename: string): PublicKeyPEM;
|
|
21
|
-
export declare function readPrivateKeyPEM(filename: string): PrivateKeyPEM;
|
|
22
|
-
export declare function setCertificateStore(store: string): string;
|
|
23
|
-
export declare function read_sshkey_as_pem(filename: string): PublicKeyPEM;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @param filename
|
|
27
|
-
*/
|
|
28
|
-
export declare function readPrivateRsaKey(filename: string): PrivateKeyPEM;
|
|
29
|
-
export declare function readPublicRsaKey(filename: string): PublicKeyPEM;
|
|
1
|
+
import { Certificate, CertificatePEM, PrivateKey, PrivateKeyPEM, PublicKey, PublicKeyPEM } from "../source/common";
|
|
2
|
+
/**
|
|
3
|
+
* @method readKeyPem
|
|
4
|
+
* @param filename
|
|
5
|
+
*/
|
|
6
|
+
export declare function readKeyPem(filename: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* read a DER or PEM certificate from file
|
|
9
|
+
*/
|
|
10
|
+
export declare function readCertificate(filename: string): Certificate;
|
|
11
|
+
/**
|
|
12
|
+
* read a DER or PEM certificate from file
|
|
13
|
+
*/
|
|
14
|
+
export declare function readPublicKey(filename: string): PublicKey;
|
|
15
|
+
/**
|
|
16
|
+
* read a DER or PEM certificate from file
|
|
17
|
+
*/
|
|
18
|
+
export declare function readPrivateKey(filename: string): PrivateKey;
|
|
19
|
+
export declare function readCertificatePEM(filename: string): CertificatePEM;
|
|
20
|
+
export declare function readPublicKeyPEM(filename: string): PublicKeyPEM;
|
|
21
|
+
export declare function readPrivateKeyPEM(filename: string): PrivateKeyPEM;
|
|
22
|
+
export declare function setCertificateStore(store: string): string;
|
|
23
|
+
export declare function read_sshkey_as_pem(filename: string): PublicKeyPEM;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param filename
|
|
27
|
+
*/
|
|
28
|
+
export declare function readPrivateRsaKey(filename: string): PrivateKeyPEM;
|
|
29
|
+
export declare function readPublicRsaKey(filename: string): PublicKeyPEM;
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readPublicRsaKey = exports.readPrivateRsaKey = exports.read_sshkey_as_pem = exports.setCertificateStore = exports.readPrivateKeyPEM = exports.readPublicKeyPEM = exports.readCertificatePEM = exports.readPrivateKey = exports.readPublicKey = exports.readCertificate = exports.readKeyPem = void 0;
|
|
4
|
-
const assert = require("assert");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
const crypto_utils_1 = require("../source/crypto_utils");
|
|
8
|
-
const sshpk = require("sshpk");
|
|
9
|
-
/**
|
|
10
|
-
* @method readKeyPem
|
|
11
|
-
* @param filename
|
|
12
|
-
*/
|
|
13
|
-
function readKeyPem(filename) {
|
|
14
|
-
const raw_key = fs.readFileSync(filename, "utf8");
|
|
15
|
-
const pemType = (0, crypto_utils_1.identifyPemType)(raw_key);
|
|
16
|
-
assert(typeof pemType === "string"); // must have a valid pem type
|
|
17
|
-
return raw_key;
|
|
18
|
-
}
|
|
19
|
-
exports.readKeyPem = readKeyPem;
|
|
20
|
-
function _readPemFile(filename) {
|
|
21
|
-
assert(typeof filename === "string");
|
|
22
|
-
return fs.readFileSync(filename, "ascii");
|
|
23
|
-
}
|
|
24
|
-
function _readPemOrDerFileAsDER(filename) {
|
|
25
|
-
if (filename.match(/.*\.der/)) {
|
|
26
|
-
return fs.readFileSync(filename);
|
|
27
|
-
}
|
|
28
|
-
const raw_key = _readPemFile(filename);
|
|
29
|
-
return (0, crypto_utils_1.convertPEMtoDER)(raw_key);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* read a DER or PEM certificate from file
|
|
33
|
-
*/
|
|
34
|
-
function readCertificate(filename) {
|
|
35
|
-
return _readPemOrDerFileAsDER(filename);
|
|
36
|
-
}
|
|
37
|
-
exports.readCertificate = readCertificate;
|
|
38
|
-
/**
|
|
39
|
-
* read a DER or PEM certificate from file
|
|
40
|
-
*/
|
|
41
|
-
function readPublicKey(filename) {
|
|
42
|
-
return _readPemOrDerFileAsDER(filename);
|
|
43
|
-
}
|
|
44
|
-
exports.readPublicKey = readPublicKey;
|
|
45
|
-
/**
|
|
46
|
-
* read a DER or PEM certificate from file
|
|
47
|
-
*/
|
|
48
|
-
function readPrivateKey(filename) {
|
|
49
|
-
return _readPemOrDerFileAsDER(filename);
|
|
50
|
-
}
|
|
51
|
-
exports.readPrivateKey = readPrivateKey;
|
|
52
|
-
function readCertificatePEM(filename) {
|
|
53
|
-
return _readPemFile(filename);
|
|
54
|
-
}
|
|
55
|
-
exports.readCertificatePEM = readCertificatePEM;
|
|
56
|
-
function readPublicKeyPEM(filename) {
|
|
57
|
-
return _readPemFile(filename);
|
|
58
|
-
}
|
|
59
|
-
exports.readPublicKeyPEM = readPublicKeyPEM;
|
|
60
|
-
function readPrivateKeyPEM(filename) {
|
|
61
|
-
return _readPemFile(filename);
|
|
62
|
-
}
|
|
63
|
-
exports.readPrivateKeyPEM = readPrivateKeyPEM;
|
|
64
|
-
let __certificate_store = path.join(__dirname, "../../certificates/");
|
|
65
|
-
function setCertificateStore(store) {
|
|
66
|
-
const old_store = __certificate_store;
|
|
67
|
-
__certificate_store = store;
|
|
68
|
-
return old_store;
|
|
69
|
-
}
|
|
70
|
-
exports.setCertificateStore = setCertificateStore;
|
|
71
|
-
function read_sshkey_as_pem(filename) {
|
|
72
|
-
if (filename.
|
|
73
|
-
filename = __certificate_store + filename;
|
|
74
|
-
}
|
|
75
|
-
const key = fs.readFileSync(filename, "ascii");
|
|
76
|
-
const sshKey = sshpk.parseKey(key, "ssh");
|
|
77
|
-
return sshKey.toString("pkcs8");
|
|
78
|
-
}
|
|
79
|
-
exports.read_sshkey_as_pem = read_sshkey_as_pem;
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
* @param filename
|
|
83
|
-
*/
|
|
84
|
-
function readPrivateRsaKey(filename) {
|
|
85
|
-
if (filename.
|
|
86
|
-
filename = __certificate_store + filename;
|
|
87
|
-
}
|
|
88
|
-
return fs.readFileSync(filename, "ascii");
|
|
89
|
-
}
|
|
90
|
-
exports.readPrivateRsaKey = readPrivateRsaKey;
|
|
91
|
-
function readPublicRsaKey(filename) {
|
|
92
|
-
return readPrivateRsaKey(filename);
|
|
93
|
-
}
|
|
94
|
-
exports.readPublicRsaKey = readPublicRsaKey;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readPublicRsaKey = exports.readPrivateRsaKey = exports.read_sshkey_as_pem = exports.setCertificateStore = exports.readPrivateKeyPEM = exports.readPublicKeyPEM = exports.readCertificatePEM = exports.readPrivateKey = exports.readPublicKey = exports.readCertificate = exports.readKeyPem = void 0;
|
|
4
|
+
const assert = require("assert");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const crypto_utils_1 = require("../source/crypto_utils");
|
|
8
|
+
const sshpk = require("sshpk");
|
|
9
|
+
/**
|
|
10
|
+
* @method readKeyPem
|
|
11
|
+
* @param filename
|
|
12
|
+
*/
|
|
13
|
+
function readKeyPem(filename) {
|
|
14
|
+
const raw_key = fs.readFileSync(filename, "utf8");
|
|
15
|
+
const pemType = (0, crypto_utils_1.identifyPemType)(raw_key);
|
|
16
|
+
assert(typeof pemType === "string"); // must have a valid pem type
|
|
17
|
+
return raw_key;
|
|
18
|
+
}
|
|
19
|
+
exports.readKeyPem = readKeyPem;
|
|
20
|
+
function _readPemFile(filename) {
|
|
21
|
+
assert(typeof filename === "string");
|
|
22
|
+
return fs.readFileSync(filename, "ascii");
|
|
23
|
+
}
|
|
24
|
+
function _readPemOrDerFileAsDER(filename) {
|
|
25
|
+
if (filename.match(/.*\.der/)) {
|
|
26
|
+
return fs.readFileSync(filename);
|
|
27
|
+
}
|
|
28
|
+
const raw_key = _readPemFile(filename);
|
|
29
|
+
return (0, crypto_utils_1.convertPEMtoDER)(raw_key);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* read a DER or PEM certificate from file
|
|
33
|
+
*/
|
|
34
|
+
function readCertificate(filename) {
|
|
35
|
+
return _readPemOrDerFileAsDER(filename);
|
|
36
|
+
}
|
|
37
|
+
exports.readCertificate = readCertificate;
|
|
38
|
+
/**
|
|
39
|
+
* read a DER or PEM certificate from file
|
|
40
|
+
*/
|
|
41
|
+
function readPublicKey(filename) {
|
|
42
|
+
return _readPemOrDerFileAsDER(filename);
|
|
43
|
+
}
|
|
44
|
+
exports.readPublicKey = readPublicKey;
|
|
45
|
+
/**
|
|
46
|
+
* read a DER or PEM certificate from file
|
|
47
|
+
*/
|
|
48
|
+
function readPrivateKey(filename) {
|
|
49
|
+
return _readPemOrDerFileAsDER(filename);
|
|
50
|
+
}
|
|
51
|
+
exports.readPrivateKey = readPrivateKey;
|
|
52
|
+
function readCertificatePEM(filename) {
|
|
53
|
+
return _readPemFile(filename);
|
|
54
|
+
}
|
|
55
|
+
exports.readCertificatePEM = readCertificatePEM;
|
|
56
|
+
function readPublicKeyPEM(filename) {
|
|
57
|
+
return _readPemFile(filename);
|
|
58
|
+
}
|
|
59
|
+
exports.readPublicKeyPEM = readPublicKeyPEM;
|
|
60
|
+
function readPrivateKeyPEM(filename) {
|
|
61
|
+
return _readPemFile(filename);
|
|
62
|
+
}
|
|
63
|
+
exports.readPrivateKeyPEM = readPrivateKeyPEM;
|
|
64
|
+
let __certificate_store = path.join(__dirname, "../../certificates/");
|
|
65
|
+
function setCertificateStore(store) {
|
|
66
|
+
const old_store = __certificate_store;
|
|
67
|
+
__certificate_store = store;
|
|
68
|
+
return old_store;
|
|
69
|
+
}
|
|
70
|
+
exports.setCertificateStore = setCertificateStore;
|
|
71
|
+
function read_sshkey_as_pem(filename) {
|
|
72
|
+
if (filename.substring(0, 1) !== ".") {
|
|
73
|
+
filename = __certificate_store + filename;
|
|
74
|
+
}
|
|
75
|
+
const key = fs.readFileSync(filename, "ascii");
|
|
76
|
+
const sshKey = sshpk.parseKey(key, "ssh");
|
|
77
|
+
return sshKey.toString("pkcs8");
|
|
78
|
+
}
|
|
79
|
+
exports.read_sshkey_as_pem = read_sshkey_as_pem;
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param filename
|
|
83
|
+
*/
|
|
84
|
+
function readPrivateRsaKey(filename) {
|
|
85
|
+
if (filename.substring(0, 1) !== "." && !fs.existsSync(filename)) {
|
|
86
|
+
filename = __certificate_store + filename;
|
|
87
|
+
}
|
|
88
|
+
return fs.readFileSync(filename, "ascii");
|
|
89
|
+
}
|
|
90
|
+
exports.readPrivateRsaKey = readPrivateRsaKey;
|
|
91
|
+
function readPublicRsaKey(filename) {
|
|
92
|
+
return readPrivateRsaKey(filename);
|
|
93
|
+
}
|
|
94
|
+
exports.readPublicRsaKey = readPublicRsaKey;
|
|
95
95
|
//# sourceMappingURL=read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../source_nodejs/read.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,yBAAyB;AACzB,6BAA6B;AAE7B,yDAA0E;AAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B;;;GAGG;AACH,SAAgB,UAAU,CAAC,QAAgB;IACvC,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAA,8BAAe,EAAC,OAAO,CAAC,CAAC;IACzC,MAAM,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,6BAA6B;IAClE,OAAO,OAAO,CAAC;AACnB,CAAC;AALD,gCAKC;AAED,SAAS,YAAY,CAAC,QAAgB;IAClC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C,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC9D,QAAQ,GAAG,mBAAmB,GAAG,QAAQ,CAAC;KAC7C;IACD,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAW,CAAC;AACxD,CAAC;AALD,8CAKC;AAED,SAAgB,gBAAgB,CAAC,QAAgB;IAC7C,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AAFD,4CAEC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CertificateRevocationList } from "../source/common";
|
|
2
|
-
export declare function readCertificateRevocationList(filename: string): Promise<CertificateRevocationList>;
|
|
1
|
+
import { CertificateRevocationList } from "../source/common";
|
|
2
|
+
export declare function readCertificateRevocationList(filename: string): Promise<CertificateRevocationList>;
|