node-opcua-crypto 5.3.0 → 5.3.2
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/{chunk-7GWSCCWS.cjs → chunk-IKQT3ICS.cjs} +96 -22
- package/dist/chunk-IKQT3ICS.cjs.map +1 -0
- package/dist/{chunk-KCVNMSLI.js → chunk-ODR4HUB7.js} +66 -15
- package/dist/chunk-ODR4HUB7.js.map +1 -0
- package/dist/{chunk-ERHE4VFS.cjs → chunk-TSW463FI.cjs} +68 -17
- package/dist/chunk-TSW463FI.cjs.map +1 -0
- package/dist/{chunk-QGNXSXUU.js → chunk-UEEZA3YS.js} +82 -8
- package/dist/chunk-UEEZA3YS.js.map +1 -0
- package/dist/index.cjs +23 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -5
- package/dist/source/index_web.cjs +6 -2
- package/dist/source/index_web.cjs.map +1 -1
- package/dist/source/index_web.d.cts +10 -1
- package/dist/source/index_web.d.ts +10 -1
- package/dist/source/index_web.js +7 -3
- package/dist/source_nodejs/index.cjs +19 -3
- package/dist/source_nodejs/index.cjs.map +1 -1
- package/dist/source_nodejs/index.d.cts +67 -2
- package/dist/source_nodejs/index.d.ts +67 -2
- package/dist/source_nodejs/index.js +20 -4
- package/package.json +5 -5
- package/dist/chunk-7GWSCCWS.cjs.map +0 -1
- package/dist/chunk-ERHE4VFS.cjs.map +0 -1
- package/dist/chunk-KCVNMSLI.js.map +0 -1
- package/dist/chunk-QGNXSXUU.js.map +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__dirname,
|
|
3
|
+
combine_der,
|
|
3
4
|
convertPEMtoDER,
|
|
4
5
|
generateKeyPair,
|
|
5
6
|
identifyPemType,
|
|
6
7
|
privateKeyToPEM,
|
|
7
8
|
removeTrailingLF,
|
|
9
|
+
split_der,
|
|
8
10
|
toPem
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ODR4HUB7.js";
|
|
10
12
|
|
|
11
13
|
// source_nodejs/generate_private_key_filename.ts
|
|
12
14
|
import { generateKeyPairSync } from "crypto";
|
|
@@ -37,15 +39,49 @@ function _readPemFile(filename) {
|
|
|
37
39
|
assert(typeof filename === "string");
|
|
38
40
|
return removeTrailingLF(fs2.readFileSync(filename, "utf-8"));
|
|
39
41
|
}
|
|
40
|
-
function
|
|
42
|
+
function _countPemCertBlocks(pem) {
|
|
43
|
+
const matches = pem.match(/-----BEGIN CERTIFICATE-----/g);
|
|
44
|
+
return matches ? matches.length : 0;
|
|
45
|
+
}
|
|
46
|
+
function readCertificate(filename) {
|
|
41
47
|
if (filename.match(/.*\.der/)) {
|
|
42
48
|
return fs2.readFileSync(filename);
|
|
43
49
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
50
|
+
const pem = _readPemFile(filename);
|
|
51
|
+
const count = _countPemCertBlocks(pem);
|
|
52
|
+
if (count > 1) {
|
|
53
|
+
console.warn(
|
|
54
|
+
`[node-opcua-crypto] readCertificate: "${path.basename(filename)}" contains ${count} PEM certificate block(s) but only the first will be used. Use readCertificateChain() to read all certificates.`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
return convertPEMtoDER(pem);
|
|
46
58
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
59
|
+
function readCertificateChain(filename) {
|
|
60
|
+
if (filename.match(/.*\.der/)) {
|
|
61
|
+
return split_der(fs2.readFileSync(filename));
|
|
62
|
+
}
|
|
63
|
+
const pem = _readPemFile(filename);
|
|
64
|
+
return _extractAllPemDerCertificates(pem);
|
|
65
|
+
}
|
|
66
|
+
async function readCertificateChainAsync(filename) {
|
|
67
|
+
const buf = await fs2.promises.readFile(filename);
|
|
68
|
+
if (filename.match(/.*\.der/)) {
|
|
69
|
+
return split_der(buf);
|
|
70
|
+
}
|
|
71
|
+
const pem = removeTrailingLF(buf.toString("utf-8"));
|
|
72
|
+
return _extractAllPemDerCertificates(pem);
|
|
73
|
+
}
|
|
74
|
+
function _extractAllPemDerCertificates(pem) {
|
|
75
|
+
const certs = [];
|
|
76
|
+
const regex = /-----BEGIN CERTIFICATE-----\r?\n([/+=a-zA-Z0-9\r\n]*)\r?\n-----END CERTIFICATE-----/g;
|
|
77
|
+
let match;
|
|
78
|
+
match = regex.exec(pem);
|
|
79
|
+
while (match !== null) {
|
|
80
|
+
const base64 = match[1].replace(/\r?\n/g, "");
|
|
81
|
+
certs.push(Buffer.from(base64, "base64"));
|
|
82
|
+
match = regex.exec(pem);
|
|
83
|
+
}
|
|
84
|
+
return certs;
|
|
49
85
|
}
|
|
50
86
|
async function readCertificateAsync(filename) {
|
|
51
87
|
const buf = await fs2.promises.readFile(filename);
|
|
@@ -53,6 +89,12 @@ async function readCertificateAsync(filename) {
|
|
|
53
89
|
return buf;
|
|
54
90
|
}
|
|
55
91
|
const raw_key = removeTrailingLF(buf.toString("utf-8"));
|
|
92
|
+
const count = _countPemCertBlocks(raw_key);
|
|
93
|
+
if (count > 1) {
|
|
94
|
+
console.warn(
|
|
95
|
+
`[node-opcua-crypto] readCertificateAsync: "${path.basename(filename)}" contains ${count} PEM certificate block(s) but only the first will be used. Use readCertificateChainAsync() to read all certificates.`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
56
98
|
return convertPEMtoDER(raw_key);
|
|
57
99
|
}
|
|
58
100
|
function readPublicKey(filename) {
|
|
@@ -184,10 +226,36 @@ async function readCertificateSigningRequest(filename) {
|
|
|
184
226
|
return convertPEMtoDER(raw_crl);
|
|
185
227
|
}
|
|
186
228
|
|
|
229
|
+
// source_nodejs/write.ts
|
|
230
|
+
import fs5 from "fs";
|
|
231
|
+
function certificatesToPem(certificates) {
|
|
232
|
+
const certs = Array.isArray(certificates) ? certificates : [certificates];
|
|
233
|
+
return `${certs.map((der) => toPem(der, "CERTIFICATE")).join("\n")}
|
|
234
|
+
`;
|
|
235
|
+
}
|
|
236
|
+
function writeCertificateChain(filename, certificates) {
|
|
237
|
+
fs5.writeFileSync(filename, certificatesToPem(certificates), "utf-8");
|
|
238
|
+
}
|
|
239
|
+
async function writeCertificateChainAsync(filename, certificates) {
|
|
240
|
+
await fs5.promises.writeFile(filename, certificatesToPem(certificates), "utf-8");
|
|
241
|
+
}
|
|
242
|
+
function certificatesToDer(certificates) {
|
|
243
|
+
const certs = Array.isArray(certificates) ? certificates : [certificates];
|
|
244
|
+
return combine_der(certs);
|
|
245
|
+
}
|
|
246
|
+
function writeCertificateChainDer(filename, certificates) {
|
|
247
|
+
fs5.writeFileSync(filename, certificatesToDer(certificates));
|
|
248
|
+
}
|
|
249
|
+
async function writeCertificateChainDerAsync(filename, certificates) {
|
|
250
|
+
await fs5.promises.writeFile(filename, certificatesToDer(certificates));
|
|
251
|
+
}
|
|
252
|
+
|
|
187
253
|
export {
|
|
188
254
|
generatePrivateKeyFile,
|
|
189
255
|
generatePrivateKeyFileAlternate,
|
|
190
256
|
readCertificate,
|
|
257
|
+
readCertificateChain,
|
|
258
|
+
readCertificateChainAsync,
|
|
191
259
|
readCertificateAsync,
|
|
192
260
|
readPublicKey,
|
|
193
261
|
readPublicKeyAsync,
|
|
@@ -204,6 +272,12 @@ export {
|
|
|
204
272
|
readPrivateRsaKey,
|
|
205
273
|
readPublicRsaKey,
|
|
206
274
|
readCertificateRevocationList,
|
|
207
|
-
readCertificateSigningRequest
|
|
275
|
+
readCertificateSigningRequest,
|
|
276
|
+
certificatesToPem,
|
|
277
|
+
writeCertificateChain,
|
|
278
|
+
writeCertificateChainAsync,
|
|
279
|
+
certificatesToDer,
|
|
280
|
+
writeCertificateChainDer,
|
|
281
|
+
writeCertificateChainDerAsync
|
|
208
282
|
};
|
|
209
|
-
//# sourceMappingURL=chunk-
|
|
283
|
+
//# sourceMappingURL=chunk-UEEZA3YS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../source_nodejs/generate_private_key_filename.ts","../source_nodejs/read.ts","../source_nodejs/read_certificate_revocation_list.ts","../source_nodejs/read_certificate_signing_request.ts","../source_nodejs/write.ts"],"sourcesContent":["// ---------------------------------------------------------------------------------------------------------------------\n// node-opcua-crypto\n// ---------------------------------------------------------------------------------------------------------------------\n// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org\n// Copyright (c) 2022-2026 - Sterfive.com\n// ---------------------------------------------------------------------------------------------------------------------\n//\n// This project is licensed under the terms of the MIT license.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the\n// Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// ---------------------------------------------------------------------------------------------------------------------\n\nimport { generateKeyPairSync } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport { generateKeyPair, privateKeyToPEM } from \"../source/index.js\";\nexport async function generatePrivateKeyFile(privateKeyFilename: string, modulusLength: 1024 | 2048 | 3072 | 4096) {\n const keys = await generateKeyPair(modulusLength);\n const privateKeyPem = await privateKeyToPEM(keys.privateKey);\n await fs.promises.writeFile(privateKeyFilename, privateKeyPem.privPem, \"utf-8\");\n privateKeyPem.privPem = \"\";\n privateKeyPem.privDer = new ArrayBuffer(0);\n}\n\n/**\n * alternate function to generate PrivateKeyFile, using native\n * node:crypto.\n *\n * This function is slower than generatePrivateKeyFile\n */\nexport async function generatePrivateKeyFileAlternate(privateKeyFilename: string, modulusLength: 2048 | 3072 | 4096) {\n const { privateKey } = generateKeyPairSync(\"rsa\", {\n modulusLength,\n privateKeyEncoding: { type: \"pkcs8\", format: \"pem\" },\n publicKeyEncoding: { type: \"spki\", format: \"pem\" },\n });\n await fs.promises.writeFile(privateKeyFilename, privateKey, \"utf-8\");\n}\n","// ---------------------------------------------------------------------------------------------------------------------\n// node-opcua-crypto\n// ---------------------------------------------------------------------------------------------------------------------\n// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org\n// Copyright (c) 2022-2026 - Sterfive.com\n// ---------------------------------------------------------------------------------------------------------------------\n//\n// This project is licensed under the terms of the MIT license.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the\n// Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// ---------------------------------------------------------------------------------------------------------------------\n\nimport assert from \"node:assert\";\nimport { createPrivateKey, createPublicKey } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport sshpk from \"sshpk\";\nimport type {\n Certificate,\n CertificatePEM,\n DER,\n KeyObject,\n PEM,\n PrivateKey,\n PrivateKeyPEM,\n PublicKey,\n PublicKeyPEM,\n} from \"../source/common.js\";\nimport { split_der } from \"../source/crypto_explore_certificate.js\";\nimport { convertPEMtoDER, identifyPemType, removeTrailingLF, toPem } from \"../source/crypto_utils.js\";\n\nfunction _readPemFile(filename: string): PEM {\n assert(typeof filename === \"string\");\n return removeTrailingLF(fs.readFileSync(filename, \"utf-8\"));\n}\n\nfunction _readPemOrDerFileAsDER(filename: string): DER {\n if (filename.match(/.*\\.der/)) {\n return fs.readFileSync(filename) as Buffer;\n }\n const raw_key: string = _readPemFile(filename);\n return convertPEMtoDER(raw_key);\n}\n\nfunction _countPemCertBlocks(pem: string): number {\n const matches = pem.match(/-----BEGIN CERTIFICATE-----/g);\n return matches ? matches.length : 0;\n}\n\n/**\n * Read a DER or PEM certificate from file.\n *\n * **Note:** If the PEM file contains multiple certificate blocks\n * (e.g. a leaf cert + CA chain), only the **first** certificate\n * is returned. Use {@link readCertificateChain} to read all\n * certificates individually.\n *\n * @deprecated Use {@link readCertificateChain} instead, which\n * returns each certificate as a separate DER buffer.\n */\nexport function readCertificate(filename: string): Certificate {\n if (filename.match(/.*\\.der/)) {\n return fs.readFileSync(filename) as Certificate;\n }\n const pem = _readPemFile(filename);\n const count = _countPemCertBlocks(pem);\n if (count > 1) {\n console.warn(\n `[node-opcua-crypto] readCertificate: \"${path.basename(filename)}\"` +\n ` contains ${count} PEM certificate block(s) but only the first` +\n ` will be used. Use readCertificateChain() to read all certificates.`,\n );\n }\n return convertPEMtoDER(pem) as Certificate;\n}\n\n/**\n * Read a PEM or DER certificate file that may contain multiple\n * certificates (e.g. a leaf cert + CA issuer chain) and return\n * each certificate as a separate DER `Buffer`.\n *\n * - For a DER file, returns a single-element array.\n * - For a PEM file with N certificate blocks, returns N elements\n * in the same order they appear in the file (leaf first).\n */\nexport function readCertificateChain(filename: string): Certificate[] {\n if (filename.match(/.*\\.der/)) {\n return split_der(fs.readFileSync(filename) as Certificate);\n }\n const pem = _readPemFile(filename);\n return _extractAllPemDerCertificates(pem);\n}\n\n/**\n * Async version of {@link readCertificateChain}.\n */\nexport async function readCertificateChainAsync(filename: string): Promise<Certificate[]> {\n const buf = await fs.promises.readFile(filename);\n if (filename.match(/.*\\.der/)) {\n return split_der(buf as Certificate);\n }\n const pem = removeTrailingLF(buf.toString(\"utf-8\"));\n return _extractAllPemDerCertificates(pem);\n}\n\n/**\n * Extract all CERTIFICATE PEM blocks from a PEM string and\n * return each as a separate DER `Buffer`.\n */\nfunction _extractAllPemDerCertificates(pem: string): Certificate[] {\n const certs: Certificate[] = [];\n const regex = /-----BEGIN CERTIFICATE-----\\r?\\n([/+=a-zA-Z0-9\\r\\n]*)\\r?\\n-----END CERTIFICATE-----/g;\n let match: RegExpExecArray | null;\n match = regex.exec(pem);\n while (match !== null) {\n const base64 = match[1].replace(/\\r?\\n/g, \"\");\n certs.push(Buffer.from(base64, \"base64\") as Certificate);\n match = regex.exec(pem);\n }\n return certs;\n}\n\n/**\n * Async version of {@link readCertificate}.\n * Uses `fs.promises.readFile` so the event loop is not blocked\n * during I/O.\n *\n * **Note:** If the PEM file contains multiple certificate blocks,\n * only the first is returned. Use {@link readCertificateChainAsync}.\n *\n * @deprecated Use {@link readCertificateChainAsync} instead.\n */\nexport async function readCertificateAsync(filename: string): Promise<Certificate> {\n const buf = await fs.promises.readFile(filename);\n if (filename.match(/.*\\.der/)) {\n return buf as Certificate;\n }\n const raw_key = removeTrailingLF(buf.toString(\"utf-8\"));\n const count = _countPemCertBlocks(raw_key);\n if (count > 1) {\n console.warn(\n `[node-opcua-crypto] readCertificateAsync: \"${path.basename(filename)}\"` +\n ` contains ${count} PEM certificate block(s) but only the first` +\n ` will be used. Use readCertificateChainAsync() to read all certificates.`,\n );\n }\n return convertPEMtoDER(raw_key) as Certificate;\n}\n\n/**\n * read a DER or PEM certificate from file\n */\nexport function readPublicKey(filename: string): KeyObject {\n if (filename.match(/.*\\.der/)) {\n const der = fs.readFileSync(filename) as Buffer;\n return createPublicKey(der);\n } else {\n const raw_key: string = _readPemFile(filename);\n return createPublicKey(raw_key);\n }\n}\n\n/**\n * Async version of {@link readPublicKey}.\n */\nexport async function readPublicKeyAsync(filename: string): Promise<KeyObject> {\n const buf = await fs.promises.readFile(filename);\n if (filename.match(/.*\\.der/)) {\n return createPublicKey(buf);\n }\n return createPublicKey(removeTrailingLF(buf.toString(\"utf-8\")));\n}\n\n// console.log(\"createPrivateKey\", (crypto as any).createPrivateKey, process.env.NO_CREATE_PRIVATEKEY);\n\nfunction myCreatePrivateKey(rawKey: string | Buffer): PrivateKey {\n if (!createPrivateKey || process.env.NO_CREATE_PRIVATEKEY) {\n // we are not running nodejs or createPrivateKey is not supported in the environment\n if (Buffer.isBuffer(rawKey)) {\n const pemKey = toPem(rawKey, \"PRIVATE KEY\");\n assert([\"RSA PRIVATE KEY\", \"PRIVATE KEY\"].indexOf(identifyPemType(pemKey) as string) >= 0);\n return { hidden: pemKey };\n }\n return { hidden: ensureTrailingLF(rawKey as string) };\n }\n // see https://askubuntu.com/questions/1409458/openssl-config-cuases-error-in-node-js-crypto-how-should-the-config-be-updated\n const backup = process.env.OPENSSL_CONF;\n process.env.OPENSSL_CONF = \"/dev/null\";\n const retValue = createPrivateKey(rawKey);\n process.env.OPENSSL_CONF = backup;\n return { hidden: retValue };\n}\n\nfunction ensureTrailingLF(str: string): string {\n return str.match(/\\n$/) ? str : `${str}\\n`;\n}\n/**\n * read a DER or PEM certificate from file\n */\nexport function readPrivateKey(filename: string): PrivateKey {\n if (filename.match(/.*\\.der/)) {\n const der: Buffer = fs.readFileSync(filename);\n return myCreatePrivateKey(der);\n } else {\n const raw_key: string = _readPemFile(filename);\n return myCreatePrivateKey(raw_key);\n }\n}\n\n/**\n * Async version of {@link readPrivateKey}.\n */\nexport async function readPrivateKeyAsync(filename: string): Promise<PrivateKey> {\n const buf = await fs.promises.readFile(filename);\n if (filename.match(/.*\\.der/)) {\n return myCreatePrivateKey(buf);\n }\n return myCreatePrivateKey(removeTrailingLF(buf.toString(\"utf-8\")));\n}\n\nexport function readCertificatePEM(filename: string): CertificatePEM {\n return _readPemFile(filename);\n}\n\n/**\n * Async version of {@link readCertificatePEM}.\n */\nexport async function readCertificatePEMAsync(filename: string): Promise<CertificatePEM> {\n const buf = await fs.promises.readFile(filename, \"utf-8\");\n return removeTrailingLF(buf);\n}\n\nexport function readPublicKeyPEM(filename: string): PublicKeyPEM {\n return _readPemFile(filename);\n}\n\n/**\n * Async version of {@link readPublicKeyPEM}.\n */\nexport async function readPublicKeyPEMAsync(filename: string): Promise<PublicKeyPEM> {\n const buf = await fs.promises.readFile(filename, \"utf-8\");\n return removeTrailingLF(buf);\n}\n/**\n *\n * @deprecated\n */\nexport function readPrivateKeyPEM(filename: string): PrivateKeyPEM {\n return _readPemFile(filename);\n}\n\n/**\n * Async version of {@link readPrivateKeyPEM}.\n * @deprecated\n */\nexport async function readPrivateKeyPEMAsync(filename: string): Promise<PrivateKeyPEM> {\n const buf = await fs.promises.readFile(filename, \"utf-8\");\n return removeTrailingLF(buf);\n}\n\nlet _g_certificate_store: string = \"\";\n\nexport function setCertificateStore(store: string): string {\n const old_store = _g_certificate_store;\n _g_certificate_store = store;\n return old_store;\n}\nexport function getCertificateStore(): string {\n if (!_g_certificate_store) {\n _g_certificate_store = path.join(__dirname, \"../../certificates/\");\n }\n return _g_certificate_store;\n}\n/**\n *\n * @param filename\n */\nexport function readPrivateRsaKey(filename: string): PrivateKey {\n if (!createPrivateKey) {\n throw new Error(\"createPrivateKey is not supported in this environment\");\n }\n if (filename.substring(0, 1) !== \".\" && !fs.existsSync(filename)) {\n filename = path.join(getCertificateStore(), filename);\n }\n const content = fs.readFileSync(filename, \"utf8\");\n const sshKey = sshpk.parsePrivateKey(content, \"auto\");\n const key = sshKey.toString(\"pkcs1\") as PEM;\n const hidden = createPrivateKey({ format: \"pem\", type: \"pkcs1\", key });\n return { hidden };\n}\n\nexport function readPublicRsaKey(filename: string): PublicKey {\n if (filename.substring(0, 1) !== \".\" && !fs.existsSync(filename)) {\n filename = path.join(getCertificateStore(), filename);\n }\n const content = fs.readFileSync(filename, \"utf-8\");\n const sshKey = sshpk.parseKey(content, \"ssh\");\n const key = sshKey.toString(\"pkcs1\") as PEM;\n return createPublicKey({ format: \"pem\", type: \"pkcs1\", key });\n}\n","// ---------------------------------------------------------------------------------------------------------------------\n// node-opcua-crypto\n// ---------------------------------------------------------------------------------------------------------------------\n// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org\n// Copyright (c) 2022-2026 - Sterfive.com\n// ---------------------------------------------------------------------------------------------------------------------\n//\n// This project is licensed under the terms of the MIT license.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the\n// Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// ---------------------------------------------------------------------------------------------------------------------\n\nimport fs from \"node:fs\";\nimport type { CertificateRevocationList } from \"../source/common.js\";\nimport { convertPEMtoDER } from \"../source/crypto_utils.js\";\n\nexport async function readCertificateRevocationList(filename: string): Promise<CertificateRevocationList> {\n const crl = await fs.promises.readFile(filename);\n if (crl[0] === 0x30 && crl[1] === 0x82) {\n // der format\n return crl as CertificateRevocationList;\n }\n const raw_crl = crl.toString();\n return convertPEMtoDER(raw_crl);\n}\n","// ---------------------------------------------------------------------------------------------------------------------\n// node-opcua-crypto\n// ---------------------------------------------------------------------------------------------------------------------\n// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org\n// Copyright (c) 2022-2026 - Sterfive.com\n// ---------------------------------------------------------------------------------------------------------------------\n//\n// This project is licensed under the terms of the MIT license.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the\n// Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// ---------------------------------------------------------------------------------------------------------------------\n\nimport fs from \"node:fs\";\nimport type { CertificateRevocationList } from \"../source/common.js\";\nimport { convertPEMtoDER } from \"../source/crypto_utils.js\";\n\nexport type CertificateSigningRequest = Buffer;\n\nexport async function readCertificateSigningRequest(filename: string): Promise<CertificateSigningRequest> {\n const csr = await fs.promises.readFile(filename);\n if (csr[0] === 0x30 && csr[1] === 0x82) {\n // der format\n return csr as CertificateRevocationList;\n }\n const raw_crl = csr.toString();\n return convertPEMtoDER(raw_crl);\n}\n","// ---------------------------------------------------------------------------------------------------------------------\n// node-opcua-crypto\n// ---------------------------------------------------------------------------------------------------------------------\n// Copyright (c) 2014-2022 - Etienne Rossignon - etienne.rossignon (at) gadz.org\n// Copyright (c) 2022-2026 - Sterfive.com\n// ---------------------------------------------------------------------------------------------------------------------\n//\n// This project is licensed under the terms of the MIT license.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the\n// Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\n// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n// ---------------------------------------------------------------------------------------------------------------------\n\nimport fs from \"node:fs\";\n\nimport type { Certificate } from \"../source/common.js\";\nimport { combine_der } from \"../source/crypto_explore_certificate.js\";\nimport { toPem } from \"../source/crypto_utils.js\";\n\n// ── PEM ──────────────────────────────────────────────────────\n\n/**\n * Convert one or more DER certificates to a PEM string.\n *\n * Accepts a single `Certificate` (DER buffer) or an array.\n * Returns a multi-block PEM string with each certificate\n * separated by a newline.\n */\nexport function certificatesToPem(certificates: Certificate | Certificate[]): string {\n const certs = Array.isArray(certificates) ? certificates : [certificates];\n return `${certs.map((der) => toPem(der, \"CERTIFICATE\")).join(\"\\n\")}\\n`;\n}\n\n/**\n * Write one or more DER certificates to a PEM file.\n *\n * Each certificate is written as a separate PEM block in the\n * order provided (typically leaf first, then issuer chain).\n */\nexport function writeCertificateChain(filename: string, certificates: Certificate | Certificate[]): void {\n fs.writeFileSync(filename, certificatesToPem(certificates), \"utf-8\");\n}\n\n/**\n * Async version of {@link writeCertificateChain}.\n */\nexport async function writeCertificateChainAsync(filename: string, certificates: Certificate | Certificate[]): Promise<void> {\n await fs.promises.writeFile(filename, certificatesToPem(certificates), \"utf-8\");\n}\n\n// ── DER ──────────────────────────────────────────────────────\n\n/**\n * Convert one or more DER certificates to a single concatenated\n * DER buffer (OPC UA certificate chain format).\n *\n * Accepts a single `Certificate` (DER buffer) or an array.\n */\nexport function certificatesToDer(certificates: Certificate | Certificate[]): Certificate {\n const certs = Array.isArray(certificates) ? certificates : [certificates];\n return combine_der(certs);\n}\n\n/**\n * Write one or more DER certificates to a `.der` file as a\n * concatenated DER chain (OPC UA binary chain format).\n *\n * Order should be leaf first, then issuer chain.\n */\nexport function writeCertificateChainDer(filename: string, certificates: Certificate | Certificate[]): void {\n fs.writeFileSync(filename, certificatesToDer(certificates));\n}\n\n/**\n * Async version of {@link writeCertificateChainDer}.\n */\nexport async function writeCertificateChainDerAsync(filename: string, certificates: Certificate | Certificate[]): Promise<void> {\n await fs.promises.writeFile(filename, certificatesToDer(certificates));\n}\n"],"mappings":";;;;;;;;;;;;;AAuBA,SAAS,2BAA2B;AACpC,OAAO,QAAQ;AAEf,eAAsB,uBAAuB,oBAA4B,eAA0C;AAC/G,QAAM,OAAO,MAAM,gBAAgB,aAAa;AAChD,QAAM,gBAAgB,MAAM,gBAAgB,KAAK,UAAU;AAC3D,QAAM,GAAG,SAAS,UAAU,oBAAoB,cAAc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e,CAAC,YAAY;AACxE,SAAO,YAAY,KAAK;AAC5B;AAQO,SAAS,yBAAyB,UAAkB,cAAiD;AACxG,EAAAA,IAAG,cAAc,UAAU,kBAAkB,YAAY,CAAC;AAC9D;AAKA,eAAsB,8BAA8B,UAAkB,cAA0D;AAC5H,QAAMA,IAAG,SAAS,UAAU,UAAU,kBAAkB,YAAY,CAAC;AACzE;","names":["fs","fs","fs","fs","fs","fs","fs","fs","fs"]}
|
package/dist/index.cjs
CHANGED
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var _chunk7GWSCCWScjs = require('./chunk-7GWSCCWS.cjs');
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
|
|
@@ -28,6 +27,7 @@ var _chunk7GWSCCWScjs = require('./chunk-7GWSCCWS.cjs');
|
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
|
|
30
|
+
var _chunkIKQT3ICScjs = require('./chunk-IKQT3ICS.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
@@ -96,7 +96,6 @@ var _chunk7GWSCCWScjs = require('./chunk-7GWSCCWS.cjs');
|
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
var _chunkERHE4VFScjs = require('./chunk-ERHE4VFS.cjs');
|
|
100
99
|
|
|
101
100
|
|
|
102
101
|
|
|
@@ -107,6 +106,7 @@ var _chunkERHE4VFScjs = require('./chunk-ERHE4VFS.cjs');
|
|
|
107
106
|
|
|
108
107
|
|
|
109
108
|
|
|
109
|
+
var _chunkTSW463FIcjs = require('./chunk-TSW463FI.cjs');
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
|
|
@@ -193,5 +193,25 @@ var _chunkERHE4VFScjs = require('./chunk-ERHE4VFS.cjs');
|
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
exports.CertificatePurpose = _chunkTSW463FIcjs.CertificatePurpose; exports.PaddingAlgorithm = _chunkTSW463FIcjs.PaddingAlgorithm; exports.RSA_PKCS1_OAEP_PADDING = _chunkTSW463FIcjs.RSA_PKCS1_OAEP_PADDING; exports.RSA_PKCS1_PADDING = _chunkTSW463FIcjs.RSA_PKCS1_PADDING; exports.Subject = _chunkTSW463FIcjs.Subject; exports._coercePrivateKey = _chunkTSW463FIcjs._coercePrivateKey; exports.asn1 = _chunkTSW463FIcjs.asn1; exports.certificateMatchesPrivateKey = _chunkTSW463FIcjs.certificateMatchesPrivateKey; exports.certificatesToDer = _chunkIKQT3ICScjs.certificatesToDer; exports.certificatesToPem = _chunkIKQT3ICScjs.certificatesToPem; exports.clearExploreCertificateCache = _chunkTSW463FIcjs.clearExploreCertificateCache; exports.coerceCertificate = _chunkTSW463FIcjs.coerceCertificate; exports.coerceCertificatePem = _chunkTSW463FIcjs.coerceCertificatePem; exports.coercePEMorDerToPrivateKey = _chunkTSW463FIcjs.coercePEMorDerToPrivateKey; exports.coercePrivateKeyPem = _chunkTSW463FIcjs.coercePrivateKeyPem; exports.coercePublicKeyPem = _chunkTSW463FIcjs.coercePublicKeyPem; exports.coerceRsaPublicKeyPem = _chunkTSW463FIcjs.coerceRsaPublicKeyPem; exports.combine_der = _chunkTSW463FIcjs.combine_der; exports.computeDerivedKeys = _chunkTSW463FIcjs.computeDerivedKeys; exports.computePaddingFooter = _chunkTSW463FIcjs.computePaddingFooter; exports.convertPEMtoDER = _chunkTSW463FIcjs.convertPEMtoDER; exports.createCertificateSigningRequest = _chunkTSW463FIcjs.createCertificateSigningRequest; exports.createPrivateKeyFromNodeJSCrypto = _chunkTSW463FIcjs.createPrivateKeyFromNodeJSCrypto; exports.createSelfSignedCertificate = _chunkTSW463FIcjs.createSelfSignedCertificate; exports.decryptBufferWithDerivedKeys = _chunkTSW463FIcjs.decryptBufferWithDerivedKeys; exports.derToPrivateKey = _chunkTSW463FIcjs.derToPrivateKey; exports.encryptBufferWithDerivedKeys = _chunkTSW463FIcjs.encryptBufferWithDerivedKeys; exports.exploreAsn1 = _chunkTSW463FIcjs.exploreAsn1; exports.exploreCertificate = _chunkTSW463FIcjs.exploreCertificate; exports.exploreCertificateInfo = _chunkTSW463FIcjs.exploreCertificateInfo; exports.exploreCertificateRevocationList = _chunkTSW463FIcjs.exploreCertificateRevocationList; exports.exploreCertificateSigningRequest = _chunkTSW463FIcjs.exploreCertificateSigningRequest; exports.explorePrivateKey = _chunkTSW463FIcjs.explorePrivateKey; exports.extractPublicKeyFromCertificate = _chunkTSW463FIcjs.extractPublicKeyFromCertificate; exports.extractPublicKeyFromCertificateSync = _chunkTSW463FIcjs.extractPublicKeyFromCertificateSync; exports.generateKeyPair = _chunkTSW463FIcjs.generateKeyPair; exports.generatePrivateKey = _chunkTSW463FIcjs.generatePrivateKey; exports.generatePrivateKeyFile = _chunkIKQT3ICScjs.generatePrivateKeyFile; exports.generatePrivateKeyFileAlternate = _chunkIKQT3ICScjs.generatePrivateKeyFileAlternate; exports.getCertificateStore = _chunkIKQT3ICScjs.getCertificateStore; exports.hexDump = _chunkTSW463FIcjs.hexDump; exports.identifyDERContent = _chunkTSW463FIcjs.identifyDERContent; exports.identifyPemType = _chunkTSW463FIcjs.identifyPemType; exports.isCrlIssuedByCertificate = _chunkTSW463FIcjs.isCrlIssuedByCertificate; exports.isKeyObject = _chunkTSW463FIcjs.isKeyObject; exports.makeMessageChunkSignature = _chunkTSW463FIcjs.makeMessageChunkSignature; exports.makeMessageChunkSignatureWithDerivedKeys = _chunkTSW463FIcjs.makeMessageChunkSignatureWithDerivedKeys; exports.makePrivateKeyFromPem = _chunkTSW463FIcjs.makePrivateKeyFromPem; exports.makePrivateKeyThumbPrint = _chunkTSW463FIcjs.makePrivateKeyThumbPrint; exports.makePseudoRandomBuffer = _chunkTSW463FIcjs.makePseudoRandomBuffer; exports.makeSHA1Thumbprint = _chunkTSW463FIcjs.makeSHA1Thumbprint; exports.pemToPrivateKey = _chunkTSW463FIcjs.pemToPrivateKey; exports.privateDecrypt = _chunkTSW463FIcjs.privateDecrypt; exports.privateDecrypt_long = _chunkTSW463FIcjs.privateDecrypt_long; exports.privateDecrypt_native = _chunkTSW463FIcjs.privateDecrypt_native; exports.privateKeyToPEM = _chunkTSW463FIcjs.privateKeyToPEM; exports.publicEncrypt = _chunkTSW463FIcjs.publicEncrypt; exports.publicEncrypt_long = _chunkTSW463FIcjs.publicEncrypt_long; exports.publicEncrypt_native = _chunkTSW463FIcjs.publicEncrypt_native; exports.publicKeyAndPrivateKeyMatches = _chunkTSW463FIcjs.publicKeyAndPrivateKeyMatches; exports.readCertificate = _chunkIKQT3ICScjs.readCertificate; exports.readCertificateAsync = _chunkIKQT3ICScjs.readCertificateAsync; exports.readCertificateChain = _chunkIKQT3ICScjs.readCertificateChain; exports.readCertificateChainAsync = _chunkIKQT3ICScjs.readCertificateChainAsync; exports.readCertificatePEM = _chunkIKQT3ICScjs.readCertificatePEM; exports.readCertificatePEMAsync = _chunkIKQT3ICScjs.readCertificatePEMAsync; exports.readCertificateRevocationList = _chunkIKQT3ICScjs.readCertificateRevocationList; exports.readCertificateSigningRequest = _chunkIKQT3ICScjs.readCertificateSigningRequest; exports.readCertificationRequestInfo = _chunkTSW463FIcjs.readCertificationRequestInfo; exports.readExtension = _chunkTSW463FIcjs.readExtension; exports.readNameForCrl = _chunkTSW463FIcjs.readNameForCrl; exports.readPrivateKey = _chunkIKQT3ICScjs.readPrivateKey; exports.readPrivateKeyAsync = _chunkIKQT3ICScjs.readPrivateKeyAsync; exports.readPrivateKeyPEM = _chunkIKQT3ICScjs.readPrivateKeyPEM; exports.readPrivateKeyPEMAsync = _chunkIKQT3ICScjs.readPrivateKeyPEMAsync; exports.readPrivateRsaKey = _chunkIKQT3ICScjs.readPrivateRsaKey; exports.readPublicKey = _chunkIKQT3ICScjs.readPublicKey; exports.readPublicKeyAsync = _chunkIKQT3ICScjs.readPublicKeyAsync; exports.readPublicKeyPEM = _chunkIKQT3ICScjs.readPublicKeyPEM; exports.readPublicKeyPEMAsync = _chunkIKQT3ICScjs.readPublicKeyPEMAsync; exports.readPublicRsaKey = _chunkIKQT3ICScjs.readPublicRsaKey; exports.readTbsCertificate = _chunkTSW463FIcjs.readTbsCertificate; exports.reduceLength = _chunkTSW463FIcjs.reduceLength; exports.removePadding = _chunkTSW463FIcjs.removePadding; exports.removeTrailingLF = _chunkTSW463FIcjs.removeTrailingLF; exports.rsaLengthPrivateKey = _chunkTSW463FIcjs.rsaLengthPrivateKey; exports.rsaLengthPublicKey = _chunkTSW463FIcjs.rsaLengthPublicKey; exports.rsaLengthRsaPublicKey = _chunkTSW463FIcjs.rsaLengthRsaPublicKey; exports.setCertificateStore = _chunkIKQT3ICScjs.setCertificateStore; exports.split_der = _chunkTSW463FIcjs.split_der; exports.toPem = _chunkTSW463FIcjs.toPem; exports.toPem2 = _chunkTSW463FIcjs.toPem2; exports.verifyCertificateChain = _chunkTSW463FIcjs.verifyCertificateChain; exports.verifyCertificateOrClrSignature = _chunkTSW463FIcjs.verifyCertificateOrClrSignature; exports.verifyCertificateRevocationListSignature = _chunkTSW463FIcjs.verifyCertificateRevocationListSignature; exports.verifyCertificateSignature = _chunkTSW463FIcjs.verifyCertificateSignature; exports.verifyChunkSignature = _chunkTSW463FIcjs.verifyChunkSignature; exports.verifyChunkSignatureWithDerivedKeys = _chunkTSW463FIcjs.verifyChunkSignatureWithDerivedKeys; exports.verifyCrlIssuedByCertificate = _chunkTSW463FIcjs.verifyCrlIssuedByCertificate; exports.verifyMessageChunkSignature = _chunkTSW463FIcjs.verifyMessageChunkSignature; exports.verify_certificate_der_structure = _chunkTSW463FIcjs.verify_certificate_der_structure; exports.writeCertificateChain = _chunkIKQT3ICScjs.writeCertificateChain; exports.writeCertificateChainAsync = _chunkIKQT3ICScjs.writeCertificateChainAsync; exports.writeCertificateChainDer = _chunkIKQT3ICScjs.writeCertificateChainDer; exports.writeCertificateChainDerAsync = _chunkIKQT3ICScjs.writeCertificateChainDerAsync;
|
|
197
217
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,w4OAAC","file":"/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/index.cjs"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AttributeTypeAndValue, AuthorityKeyIdentifier, BasicConstraints, CertificateExtension, CertificateInfo, CertificateInternals, CertificateRevocationListInfo, CertificateSerialNumber, CertificateSigningRequestInfo, ComputeDerivedKeysOptions, CreateSelfSignCertificateOptions, DERContentType, DerivedKeys, DirectoryName, ExtensionRequest, Extensions, Name, PaddingAlgorithm, PrivateKeyInternals, PublicKeyLength, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, RevokedCertificate, Subject, SubjectAltName, SubjectOptions, SubjectPublicKey, SubjectPublicKeyInfo, TBSCertList, TbsCertificate, Validity, VerifyChunkSignatureOptions, VerifyMessageChunkSignatureOptions, Version, X509ExtKeyUsage, X509KeyUsage, _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature } from './source/index_web.cjs';
|
|
2
|
-
export { CertificateSigningRequest, generatePrivateKeyFile, generatePrivateKeyFileAlternate, getCertificateStore, readCertificate, readCertificateAsync, readCertificatePEM, readCertificatePEMAsync, readCertificateRevocationList, readCertificateSigningRequest, readPrivateKey, readPrivateKeyAsync, readPrivateKeyPEM, readPrivateKeyPEMAsync, readPrivateRsaKey, readPublicKey, readPublicKeyAsync, readPublicKeyPEM, readPublicKeyPEMAsync, readPublicRsaKey, setCertificateStore } from './source_nodejs/index.cjs';
|
|
1
|
+
export { AttributeTypeAndValue, AuthorityKeyIdentifier, BasicConstraints, CertificateExtension, CertificateInfo, CertificateInternals, CertificateRevocationListInfo, CertificateSerialNumber, CertificateSigningRequestInfo, ComputeDerivedKeysOptions, CreateSelfSignCertificateOptions, DERContentType, DerivedKeys, DirectoryName, ExtensionRequest, Extensions, Name, PaddingAlgorithm, PrivateKeyInternals, PublicKeyLength, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, RevokedCertificate, Subject, SubjectAltName, SubjectOptions, SubjectPublicKey, SubjectPublicKeyInfo, TBSCertList, TbsCertificate, Validity, VerifyChunkSignatureOptions, VerifyMessageChunkSignatureOptions, Version, X509ExtKeyUsage, X509KeyUsage, _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, clearExploreCertificateCache, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature, verify_certificate_der_structure } from './source/index_web.cjs';
|
|
2
|
+
export { CertificateSigningRequest, certificatesToDer, certificatesToPem, generatePrivateKeyFile, generatePrivateKeyFileAlternate, getCertificateStore, readCertificate, readCertificateAsync, readCertificateChain, readCertificateChainAsync, readCertificatePEM, readCertificatePEMAsync, readCertificateRevocationList, readCertificateSigningRequest, readPrivateKey, readPrivateKeyAsync, readPrivateKeyPEM, readPrivateKeyPEMAsync, readPrivateRsaKey, readPublicKey, readPublicKeyAsync, readPublicKeyPEM, readPublicKeyPEMAsync, readPublicRsaKey, setCertificateStore, writeCertificateChain, writeCertificateChainAsync, writeCertificateChainDer, writeCertificateChainDerAsync } from './source_nodejs/index.cjs';
|
|
3
3
|
export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from './common-DxHkx4Pv.cjs';
|
|
4
4
|
import '@peculiar/x509';
|
|
5
5
|
import 'node:crypto';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AttributeTypeAndValue, AuthorityKeyIdentifier, BasicConstraints, CertificateExtension, CertificateInfo, CertificateInternals, CertificateRevocationListInfo, CertificateSerialNumber, CertificateSigningRequestInfo, ComputeDerivedKeysOptions, CreateSelfSignCertificateOptions, DERContentType, DerivedKeys, DirectoryName, ExtensionRequest, Extensions, Name, PaddingAlgorithm, PrivateKeyInternals, PublicKeyLength, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, RevokedCertificate, Subject, SubjectAltName, SubjectOptions, SubjectPublicKey, SubjectPublicKeyInfo, TBSCertList, TbsCertificate, Validity, VerifyChunkSignatureOptions, VerifyMessageChunkSignatureOptions, Version, X509ExtKeyUsage, X509KeyUsage, _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature } from './source/index_web.js';
|
|
2
|
-
export { CertificateSigningRequest, generatePrivateKeyFile, generatePrivateKeyFileAlternate, getCertificateStore, readCertificate, readCertificateAsync, readCertificatePEM, readCertificatePEMAsync, readCertificateRevocationList, readCertificateSigningRequest, readPrivateKey, readPrivateKeyAsync, readPrivateKeyPEM, readPrivateKeyPEMAsync, readPrivateRsaKey, readPublicKey, readPublicKeyAsync, readPublicKeyPEM, readPublicKeyPEMAsync, readPublicRsaKey, setCertificateStore } from './source_nodejs/index.js';
|
|
1
|
+
export { AttributeTypeAndValue, AuthorityKeyIdentifier, BasicConstraints, CertificateExtension, CertificateInfo, CertificateInternals, CertificateRevocationListInfo, CertificateSerialNumber, CertificateSigningRequestInfo, ComputeDerivedKeysOptions, CreateSelfSignCertificateOptions, DERContentType, DerivedKeys, DirectoryName, ExtensionRequest, Extensions, Name, PaddingAlgorithm, PrivateKeyInternals, PublicKeyLength, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, RevokedCertificate, Subject, SubjectAltName, SubjectOptions, SubjectPublicKey, SubjectPublicKeyInfo, TBSCertList, TbsCertificate, Validity, VerifyChunkSignatureOptions, VerifyMessageChunkSignatureOptions, Version, X509ExtKeyUsage, X509KeyUsage, _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, clearExploreCertificateCache, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature, verify_certificate_der_structure } from './source/index_web.js';
|
|
2
|
+
export { CertificateSigningRequest, certificatesToDer, certificatesToPem, generatePrivateKeyFile, generatePrivateKeyFileAlternate, getCertificateStore, readCertificate, readCertificateAsync, readCertificateChain, readCertificateChainAsync, readCertificatePEM, readCertificatePEMAsync, readCertificateRevocationList, readCertificateSigningRequest, readPrivateKey, readPrivateKeyAsync, readPrivateKeyPEM, readPrivateKeyPEMAsync, readPrivateRsaKey, readPublicKey, readPublicKeyAsync, readPublicKeyPEM, readPublicKeyPEMAsync, readPublicRsaKey, setCertificateStore, writeCertificateChain, writeCertificateChainAsync, writeCertificateChainDer, writeCertificateChainDerAsync } from './source_nodejs/index.js';
|
|
3
3
|
export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from './common-DxHkx4Pv.js';
|
|
4
4
|
import '@peculiar/x509';
|
|
5
5
|
import 'node:crypto';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
certificatesToDer,
|
|
3
|
+
certificatesToPem,
|
|
2
4
|
generatePrivateKeyFile,
|
|
3
5
|
generatePrivateKeyFileAlternate,
|
|
4
6
|
getCertificateStore,
|
|
5
7
|
readCertificate,
|
|
6
8
|
readCertificateAsync,
|
|
9
|
+
readCertificateChain,
|
|
10
|
+
readCertificateChainAsync,
|
|
7
11
|
readCertificatePEM,
|
|
8
12
|
readCertificatePEMAsync,
|
|
9
13
|
readCertificateRevocationList,
|
|
@@ -18,8 +22,12 @@ import {
|
|
|
18
22
|
readPublicKeyPEM,
|
|
19
23
|
readPublicKeyPEMAsync,
|
|
20
24
|
readPublicRsaKey,
|
|
21
|
-
setCertificateStore
|
|
22
|
-
|
|
25
|
+
setCertificateStore,
|
|
26
|
+
writeCertificateChain,
|
|
27
|
+
writeCertificateChainAsync,
|
|
28
|
+
writeCertificateChainDer,
|
|
29
|
+
writeCertificateChainDerAsync
|
|
30
|
+
} from "./chunk-UEEZA3YS.js";
|
|
23
31
|
import {
|
|
24
32
|
CertificatePurpose,
|
|
25
33
|
PaddingAlgorithm,
|
|
@@ -29,6 +37,7 @@ import {
|
|
|
29
37
|
_coercePrivateKey,
|
|
30
38
|
asn1,
|
|
31
39
|
certificateMatchesPrivateKey,
|
|
40
|
+
clearExploreCertificateCache,
|
|
32
41
|
coerceCertificate,
|
|
33
42
|
coerceCertificatePem,
|
|
34
43
|
coercePEMorDerToPrivateKey,
|
|
@@ -95,8 +104,9 @@ import {
|
|
|
95
104
|
verifyChunkSignature,
|
|
96
105
|
verifyChunkSignatureWithDerivedKeys,
|
|
97
106
|
verifyCrlIssuedByCertificate,
|
|
98
|
-
verifyMessageChunkSignature
|
|
99
|
-
|
|
107
|
+
verifyMessageChunkSignature,
|
|
108
|
+
verify_certificate_der_structure
|
|
109
|
+
} from "./chunk-ODR4HUB7.js";
|
|
100
110
|
export {
|
|
101
111
|
CertificatePurpose,
|
|
102
112
|
PaddingAlgorithm,
|
|
@@ -106,6 +116,9 @@ export {
|
|
|
106
116
|
_coercePrivateKey,
|
|
107
117
|
asn1,
|
|
108
118
|
certificateMatchesPrivateKey,
|
|
119
|
+
certificatesToDer,
|
|
120
|
+
certificatesToPem,
|
|
121
|
+
clearExploreCertificateCache,
|
|
109
122
|
coerceCertificate,
|
|
110
123
|
coerceCertificatePem,
|
|
111
124
|
coercePEMorDerToPrivateKey,
|
|
@@ -157,6 +170,8 @@ export {
|
|
|
157
170
|
publicKeyAndPrivateKeyMatches,
|
|
158
171
|
readCertificate,
|
|
159
172
|
readCertificateAsync,
|
|
173
|
+
readCertificateChain,
|
|
174
|
+
readCertificateChainAsync,
|
|
160
175
|
readCertificatePEM,
|
|
161
176
|
readCertificatePEMAsync,
|
|
162
177
|
readCertificateRevocationList,
|
|
@@ -192,6 +207,11 @@ export {
|
|
|
192
207
|
verifyChunkSignature,
|
|
193
208
|
verifyChunkSignatureWithDerivedKeys,
|
|
194
209
|
verifyCrlIssuedByCertificate,
|
|
195
|
-
verifyMessageChunkSignature
|
|
210
|
+
verifyMessageChunkSignature,
|
|
211
|
+
verify_certificate_der_structure,
|
|
212
|
+
writeCertificateChain,
|
|
213
|
+
writeCertificateChainAsync,
|
|
214
|
+
writeCertificateChainDer,
|
|
215
|
+
writeCertificateChainDerAsync
|
|
196
216
|
};
|
|
197
217
|
//# sourceMappingURL=index.js.map
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
var _chunkERHE4VFScjs = require('../chunk-ERHE4VFS.cjs');
|
|
78
77
|
|
|
79
78
|
|
|
79
|
+
var _chunkTSW463FIcjs = require('../chunk-TSW463FI.cjs');
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
@@ -151,5 +151,9 @@ var _chunkERHE4VFScjs = require('../chunk-ERHE4VFS.cjs');
|
|
|
151
151
|
|
|
152
152
|
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
exports.CertificatePurpose = _chunkTSW463FIcjs.CertificatePurpose; exports.PaddingAlgorithm = _chunkTSW463FIcjs.PaddingAlgorithm; exports.RSA_PKCS1_OAEP_PADDING = _chunkTSW463FIcjs.RSA_PKCS1_OAEP_PADDING; exports.RSA_PKCS1_PADDING = _chunkTSW463FIcjs.RSA_PKCS1_PADDING; exports.Subject = _chunkTSW463FIcjs.Subject; exports._coercePrivateKey = _chunkTSW463FIcjs._coercePrivateKey; exports.asn1 = _chunkTSW463FIcjs.asn1; exports.certificateMatchesPrivateKey = _chunkTSW463FIcjs.certificateMatchesPrivateKey; exports.clearExploreCertificateCache = _chunkTSW463FIcjs.clearExploreCertificateCache; exports.coerceCertificate = _chunkTSW463FIcjs.coerceCertificate; exports.coerceCertificatePem = _chunkTSW463FIcjs.coerceCertificatePem; exports.coercePEMorDerToPrivateKey = _chunkTSW463FIcjs.coercePEMorDerToPrivateKey; exports.coercePrivateKeyPem = _chunkTSW463FIcjs.coercePrivateKeyPem; exports.coercePublicKeyPem = _chunkTSW463FIcjs.coercePublicKeyPem; exports.coerceRsaPublicKeyPem = _chunkTSW463FIcjs.coerceRsaPublicKeyPem; exports.combine_der = _chunkTSW463FIcjs.combine_der; exports.computeDerivedKeys = _chunkTSW463FIcjs.computeDerivedKeys; exports.computePaddingFooter = _chunkTSW463FIcjs.computePaddingFooter; exports.convertPEMtoDER = _chunkTSW463FIcjs.convertPEMtoDER; exports.createCertificateSigningRequest = _chunkTSW463FIcjs.createCertificateSigningRequest; exports.createPrivateKeyFromNodeJSCrypto = _chunkTSW463FIcjs.createPrivateKeyFromNodeJSCrypto; exports.createSelfSignedCertificate = _chunkTSW463FIcjs.createSelfSignedCertificate; exports.decryptBufferWithDerivedKeys = _chunkTSW463FIcjs.decryptBufferWithDerivedKeys; exports.derToPrivateKey = _chunkTSW463FIcjs.derToPrivateKey; exports.encryptBufferWithDerivedKeys = _chunkTSW463FIcjs.encryptBufferWithDerivedKeys; exports.exploreAsn1 = _chunkTSW463FIcjs.exploreAsn1; exports.exploreCertificate = _chunkTSW463FIcjs.exploreCertificate; exports.exploreCertificateInfo = _chunkTSW463FIcjs.exploreCertificateInfo; exports.exploreCertificateRevocationList = _chunkTSW463FIcjs.exploreCertificateRevocationList; exports.exploreCertificateSigningRequest = _chunkTSW463FIcjs.exploreCertificateSigningRequest; exports.explorePrivateKey = _chunkTSW463FIcjs.explorePrivateKey; exports.extractPublicKeyFromCertificate = _chunkTSW463FIcjs.extractPublicKeyFromCertificate; exports.extractPublicKeyFromCertificateSync = _chunkTSW463FIcjs.extractPublicKeyFromCertificateSync; exports.generateKeyPair = _chunkTSW463FIcjs.generateKeyPair; exports.generatePrivateKey = _chunkTSW463FIcjs.generatePrivateKey; exports.hexDump = _chunkTSW463FIcjs.hexDump; exports.identifyDERContent = _chunkTSW463FIcjs.identifyDERContent; exports.identifyPemType = _chunkTSW463FIcjs.identifyPemType; exports.isCrlIssuedByCertificate = _chunkTSW463FIcjs.isCrlIssuedByCertificate; exports.isKeyObject = _chunkTSW463FIcjs.isKeyObject; exports.makeMessageChunkSignature = _chunkTSW463FIcjs.makeMessageChunkSignature; exports.makeMessageChunkSignatureWithDerivedKeys = _chunkTSW463FIcjs.makeMessageChunkSignatureWithDerivedKeys; exports.makePrivateKeyFromPem = _chunkTSW463FIcjs.makePrivateKeyFromPem; exports.makePrivateKeyThumbPrint = _chunkTSW463FIcjs.makePrivateKeyThumbPrint; exports.makePseudoRandomBuffer = _chunkTSW463FIcjs.makePseudoRandomBuffer; exports.makeSHA1Thumbprint = _chunkTSW463FIcjs.makeSHA1Thumbprint; exports.pemToPrivateKey = _chunkTSW463FIcjs.pemToPrivateKey; exports.privateDecrypt = _chunkTSW463FIcjs.privateDecrypt; exports.privateDecrypt_long = _chunkTSW463FIcjs.privateDecrypt_long; exports.privateDecrypt_native = _chunkTSW463FIcjs.privateDecrypt_native; exports.privateKeyToPEM = _chunkTSW463FIcjs.privateKeyToPEM; exports.publicEncrypt = _chunkTSW463FIcjs.publicEncrypt; exports.publicEncrypt_long = _chunkTSW463FIcjs.publicEncrypt_long; exports.publicEncrypt_native = _chunkTSW463FIcjs.publicEncrypt_native; exports.publicKeyAndPrivateKeyMatches = _chunkTSW463FIcjs.publicKeyAndPrivateKeyMatches; exports.readCertificationRequestInfo = _chunkTSW463FIcjs.readCertificationRequestInfo; exports.readExtension = _chunkTSW463FIcjs.readExtension; exports.readNameForCrl = _chunkTSW463FIcjs.readNameForCrl; exports.readTbsCertificate = _chunkTSW463FIcjs.readTbsCertificate; exports.reduceLength = _chunkTSW463FIcjs.reduceLength; exports.removePadding = _chunkTSW463FIcjs.removePadding; exports.removeTrailingLF = _chunkTSW463FIcjs.removeTrailingLF; exports.rsaLengthPrivateKey = _chunkTSW463FIcjs.rsaLengthPrivateKey; exports.rsaLengthPublicKey = _chunkTSW463FIcjs.rsaLengthPublicKey; exports.rsaLengthRsaPublicKey = _chunkTSW463FIcjs.rsaLengthRsaPublicKey; exports.split_der = _chunkTSW463FIcjs.split_der; exports.toPem = _chunkTSW463FIcjs.toPem; exports.toPem2 = _chunkTSW463FIcjs.toPem2; exports.verifyCertificateChain = _chunkTSW463FIcjs.verifyCertificateChain; exports.verifyCertificateOrClrSignature = _chunkTSW463FIcjs.verifyCertificateOrClrSignature; exports.verifyCertificateRevocationListSignature = _chunkTSW463FIcjs.verifyCertificateRevocationListSignature; exports.verifyCertificateSignature = _chunkTSW463FIcjs.verifyCertificateSignature; exports.verifyChunkSignature = _chunkTSW463FIcjs.verifyChunkSignature; exports.verifyChunkSignatureWithDerivedKeys = _chunkTSW463FIcjs.verifyChunkSignatureWithDerivedKeys; exports.verifyCrlIssuedByCertificate = _chunkTSW463FIcjs.verifyCrlIssuedByCertificate; exports.verifyMessageChunkSignature = _chunkTSW463FIcjs.verifyMessageChunkSignature; exports.verify_certificate_der_structure = _chunkTSW463FIcjs.verify_certificate_der_structure;
|
|
155
159
|
//# sourceMappingURL=index_web.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/source/index_web.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/source/index_web.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,k6KAAC","file":"/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/source/index_web.cjs"}
|
|
@@ -196,6 +196,7 @@ interface CertificateInternals {
|
|
|
196
196
|
signatureAlgorithm: AlgorithmIdentifier;
|
|
197
197
|
signatureValue: SignatureValue;
|
|
198
198
|
}
|
|
199
|
+
declare function clearExploreCertificateCache(): void;
|
|
199
200
|
/**
|
|
200
201
|
* explore a certificate structure
|
|
201
202
|
* @param certificate
|
|
@@ -209,6 +210,14 @@ declare function exploreCertificate(certificate: Certificate): CertificateIntern
|
|
|
209
210
|
* @returns an array of Der , each element of the array is one certificate of the chain
|
|
210
211
|
*/
|
|
211
212
|
declare function split_der(certificateChain: Certificate): Certificate[];
|
|
213
|
+
/**
|
|
214
|
+
* @method verify_certificate_der_structure
|
|
215
|
+
* Verify that a certificate or certificate chain is structurally well-formed DER.
|
|
216
|
+
* Ensures the blocks parse correctly and the length exactly matches the buffer length.
|
|
217
|
+
* @param cert the DER certificate or chain to verify
|
|
218
|
+
* @throws {Error} if the structure is invalid or truncated
|
|
219
|
+
*/
|
|
220
|
+
declare function verify_certificate_der_structure(cert: Certificate): void;
|
|
212
221
|
/**
|
|
213
222
|
* @method combine_der
|
|
214
223
|
* combine an array of certificates into a single blob
|
|
@@ -574,4 +583,4 @@ declare const asn1: {
|
|
|
574
583
|
readSignatureValueBin: typeof readSignatureValueBin;
|
|
575
584
|
};
|
|
576
585
|
|
|
577
|
-
export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DERContentType, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectAltName, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature };
|
|
586
|
+
export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DERContentType, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectAltName, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, clearExploreCertificateCache, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature, verify_certificate_der_structure };
|
|
@@ -196,6 +196,7 @@ interface CertificateInternals {
|
|
|
196
196
|
signatureAlgorithm: AlgorithmIdentifier;
|
|
197
197
|
signatureValue: SignatureValue;
|
|
198
198
|
}
|
|
199
|
+
declare function clearExploreCertificateCache(): void;
|
|
199
200
|
/**
|
|
200
201
|
* explore a certificate structure
|
|
201
202
|
* @param certificate
|
|
@@ -209,6 +210,14 @@ declare function exploreCertificate(certificate: Certificate): CertificateIntern
|
|
|
209
210
|
* @returns an array of Der , each element of the array is one certificate of the chain
|
|
210
211
|
*/
|
|
211
212
|
declare function split_der(certificateChain: Certificate): Certificate[];
|
|
213
|
+
/**
|
|
214
|
+
* @method verify_certificate_der_structure
|
|
215
|
+
* Verify that a certificate or certificate chain is structurally well-formed DER.
|
|
216
|
+
* Ensures the blocks parse correctly and the length exactly matches the buffer length.
|
|
217
|
+
* @param cert the DER certificate or chain to verify
|
|
218
|
+
* @throws {Error} if the structure is invalid or truncated
|
|
219
|
+
*/
|
|
220
|
+
declare function verify_certificate_der_structure(cert: Certificate): void;
|
|
212
221
|
/**
|
|
213
222
|
* @method combine_der
|
|
214
223
|
* combine an array of certificates into a single blob
|
|
@@ -574,4 +583,4 @@ declare const asn1: {
|
|
|
574
583
|
readSignatureValueBin: typeof readSignatureValueBin;
|
|
575
584
|
};
|
|
576
585
|
|
|
577
|
-
export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DERContentType, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectAltName, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature };
|
|
586
|
+
export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DERContentType, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectAltName, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, clearExploreCertificateCache, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyDERContent, identifyPemType, isCrlIssuedByCertificate, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyCrlIssuedByCertificate, verifyMessageChunkSignature, verify_certificate_der_structure };
|
package/dist/source/index_web.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
_coercePrivateKey,
|
|
8
8
|
asn1,
|
|
9
9
|
certificateMatchesPrivateKey,
|
|
10
|
+
clearExploreCertificateCache,
|
|
10
11
|
coerceCertificate,
|
|
11
12
|
coerceCertificatePem,
|
|
12
13
|
coercePEMorDerToPrivateKey,
|
|
@@ -73,8 +74,9 @@ import {
|
|
|
73
74
|
verifyChunkSignature,
|
|
74
75
|
verifyChunkSignatureWithDerivedKeys,
|
|
75
76
|
verifyCrlIssuedByCertificate,
|
|
76
|
-
verifyMessageChunkSignature
|
|
77
|
-
|
|
77
|
+
verifyMessageChunkSignature,
|
|
78
|
+
verify_certificate_der_structure
|
|
79
|
+
} from "../chunk-ODR4HUB7.js";
|
|
78
80
|
export {
|
|
79
81
|
CertificatePurpose,
|
|
80
82
|
PaddingAlgorithm,
|
|
@@ -84,6 +86,7 @@ export {
|
|
|
84
86
|
_coercePrivateKey,
|
|
85
87
|
asn1,
|
|
86
88
|
certificateMatchesPrivateKey,
|
|
89
|
+
clearExploreCertificateCache,
|
|
87
90
|
coerceCertificate,
|
|
88
91
|
coerceCertificatePem,
|
|
89
92
|
coercePEMorDerToPrivateKey,
|
|
@@ -150,6 +153,7 @@ export {
|
|
|
150
153
|
verifyChunkSignature,
|
|
151
154
|
verifyChunkSignatureWithDerivedKeys,
|
|
152
155
|
verifyCrlIssuedByCertificate,
|
|
153
|
-
verifyMessageChunkSignature
|
|
156
|
+
verifyMessageChunkSignature,
|
|
157
|
+
verify_certificate_der_structure
|
|
154
158
|
};
|
|
155
159
|
//# sourceMappingURL=index_web.js.map
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var _chunk7GWSCCWScjs = require('../chunk-7GWSCCWS.cjs');
|
|
23
|
-
require('../chunk-ERHE4VFS.cjs');
|
|
24
22
|
|
|
25
23
|
|
|
26
24
|
|
|
@@ -29,6 +27,8 @@ require('../chunk-ERHE4VFS.cjs');
|
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
|
|
30
|
+
var _chunkIKQT3ICScjs = require('../chunk-IKQT3ICS.cjs');
|
|
31
|
+
require('../chunk-TSW463FI.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -42,5 +42,21 @@ require('../chunk-ERHE4VFS.cjs');
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
exports.certificatesToDer = _chunkIKQT3ICScjs.certificatesToDer; exports.certificatesToPem = _chunkIKQT3ICScjs.certificatesToPem; exports.generatePrivateKeyFile = _chunkIKQT3ICScjs.generatePrivateKeyFile; exports.generatePrivateKeyFileAlternate = _chunkIKQT3ICScjs.generatePrivateKeyFileAlternate; exports.getCertificateStore = _chunkIKQT3ICScjs.getCertificateStore; exports.readCertificate = _chunkIKQT3ICScjs.readCertificate; exports.readCertificateAsync = _chunkIKQT3ICScjs.readCertificateAsync; exports.readCertificateChain = _chunkIKQT3ICScjs.readCertificateChain; exports.readCertificateChainAsync = _chunkIKQT3ICScjs.readCertificateChainAsync; exports.readCertificatePEM = _chunkIKQT3ICScjs.readCertificatePEM; exports.readCertificatePEMAsync = _chunkIKQT3ICScjs.readCertificatePEMAsync; exports.readCertificateRevocationList = _chunkIKQT3ICScjs.readCertificateRevocationList; exports.readCertificateSigningRequest = _chunkIKQT3ICScjs.readCertificateSigningRequest; exports.readPrivateKey = _chunkIKQT3ICScjs.readPrivateKey; exports.readPrivateKeyAsync = _chunkIKQT3ICScjs.readPrivateKeyAsync; exports.readPrivateKeyPEM = _chunkIKQT3ICScjs.readPrivateKeyPEM; exports.readPrivateKeyPEMAsync = _chunkIKQT3ICScjs.readPrivateKeyPEMAsync; exports.readPrivateRsaKey = _chunkIKQT3ICScjs.readPrivateRsaKey; exports.readPublicKey = _chunkIKQT3ICScjs.readPublicKey; exports.readPublicKeyAsync = _chunkIKQT3ICScjs.readPublicKeyAsync; exports.readPublicKeyPEM = _chunkIKQT3ICScjs.readPublicKeyPEM; exports.readPublicKeyPEMAsync = _chunkIKQT3ICScjs.readPublicKeyPEMAsync; exports.readPublicRsaKey = _chunkIKQT3ICScjs.readPublicRsaKey; exports.setCertificateStore = _chunkIKQT3ICScjs.setCertificateStore; exports.writeCertificateChain = _chunkIKQT3ICScjs.writeCertificateChain; exports.writeCertificateChainAsync = _chunkIKQT3ICScjs.writeCertificateChainAsync; exports.writeCertificateChainDer = _chunkIKQT3ICScjs.writeCertificateChainDer; exports.writeCertificateChainDerAsync = _chunkIKQT3ICScjs.writeCertificateChainDerAsync;
|
|
46
62
|
//# sourceMappingURL=index.cjs.map
|