node-opcua-crypto 5.3.2 → 5.3.3

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.
@@ -7,14 +7,14 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkTSW463FIcjs = require('./chunk-TSW463FI.cjs');
10
+ var _chunkR6I4NJSZcjs = require('./chunk-R6I4NJSZ.cjs');
11
11
 
12
12
  // source_nodejs/generate_private_key_filename.ts
13
13
  var _crypto = require('crypto');
14
14
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
15
15
  async function generatePrivateKeyFile(privateKeyFilename, modulusLength) {
16
- const keys = await _chunkTSW463FIcjs.generateKeyPair.call(void 0, modulusLength);
17
- const privateKeyPem = await _chunkTSW463FIcjs.privateKeyToPEM.call(void 0, keys.privateKey);
16
+ const keys = await _chunkR6I4NJSZcjs.generateKeyPair.call(void 0, modulusLength);
17
+ const privateKeyPem = await _chunkR6I4NJSZcjs.privateKeyToPEM.call(void 0, keys.privateKey);
18
18
  await _fs2.default.promises.writeFile(privateKeyFilename, privateKeyPem.privPem, "utf-8");
19
19
  privateKeyPem.privPem = "";
20
20
  privateKeyPem.privDer = new ArrayBuffer(0);
@@ -36,7 +36,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
36
36
  var _sshpk = require('sshpk'); var _sshpk2 = _interopRequireDefault(_sshpk);
37
37
  function _readPemFile(filename) {
38
38
  _assert2.default.call(void 0, typeof filename === "string");
39
- return _chunkTSW463FIcjs.removeTrailingLF.call(void 0, _fs2.default.readFileSync(filename, "utf-8"));
39
+ return _chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, _fs2.default.readFileSync(filename, "utf-8"));
40
40
  }
41
41
  function _countPemCertBlocks(pem) {
42
42
  const matches = pem.match(/-----BEGIN CERTIFICATE-----/g);
@@ -53,11 +53,11 @@ function readCertificate(filename) {
53
53
  `[node-opcua-crypto] readCertificate: "${_path2.default.basename(filename)}" contains ${count} PEM certificate block(s) but only the first will be used. Use readCertificateChain() to read all certificates.`
54
54
  );
55
55
  }
56
- return _chunkTSW463FIcjs.convertPEMtoDER.call(void 0, pem);
56
+ return _chunkR6I4NJSZcjs.convertPEMtoDER.call(void 0, pem);
57
57
  }
58
58
  function readCertificateChain(filename) {
59
59
  if (filename.match(/.*\.der/)) {
60
- return _chunkTSW463FIcjs.split_der.call(void 0, _fs2.default.readFileSync(filename));
60
+ return _chunkR6I4NJSZcjs.split_der.call(void 0, _fs2.default.readFileSync(filename));
61
61
  }
62
62
  const pem = _readPemFile(filename);
63
63
  return _extractAllPemDerCertificates(pem);
@@ -65,9 +65,9 @@ function readCertificateChain(filename) {
65
65
  async function readCertificateChainAsync(filename) {
66
66
  const buf = await _fs2.default.promises.readFile(filename);
67
67
  if (filename.match(/.*\.der/)) {
68
- return _chunkTSW463FIcjs.split_der.call(void 0, buf);
68
+ return _chunkR6I4NJSZcjs.split_der.call(void 0, buf);
69
69
  }
70
- const pem = _chunkTSW463FIcjs.removeTrailingLF.call(void 0, buf.toString("utf-8"));
70
+ const pem = _chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, buf.toString("utf-8"));
71
71
  return _extractAllPemDerCertificates(pem);
72
72
  }
73
73
  function _extractAllPemDerCertificates(pem) {
@@ -87,14 +87,14 @@ async function readCertificateAsync(filename) {
87
87
  if (filename.match(/.*\.der/)) {
88
88
  return buf;
89
89
  }
90
- const raw_key = _chunkTSW463FIcjs.removeTrailingLF.call(void 0, buf.toString("utf-8"));
90
+ const raw_key = _chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, buf.toString("utf-8"));
91
91
  const count = _countPemCertBlocks(raw_key);
92
92
  if (count > 1) {
93
93
  console.warn(
94
94
  `[node-opcua-crypto] readCertificateAsync: "${_path2.default.basename(filename)}" contains ${count} PEM certificate block(s) but only the first will be used. Use readCertificateChainAsync() to read all certificates.`
95
95
  );
96
96
  }
97
- return _chunkTSW463FIcjs.convertPEMtoDER.call(void 0, raw_key);
97
+ return _chunkR6I4NJSZcjs.convertPEMtoDER.call(void 0, raw_key);
98
98
  }
99
99
  function readPublicKey(filename) {
100
100
  if (filename.match(/.*\.der/)) {
@@ -110,13 +110,13 @@ async function readPublicKeyAsync(filename) {
110
110
  if (filename.match(/.*\.der/)) {
111
111
  return _crypto.createPublicKey.call(void 0, buf);
112
112
  }
113
- return _crypto.createPublicKey.call(void 0, _chunkTSW463FIcjs.removeTrailingLF.call(void 0, buf.toString("utf-8")));
113
+ return _crypto.createPublicKey.call(void 0, _chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, buf.toString("utf-8")));
114
114
  }
115
115
  function myCreatePrivateKey(rawKey) {
116
116
  if (!_crypto.createPrivateKey || process.env.NO_CREATE_PRIVATEKEY) {
117
117
  if (Buffer.isBuffer(rawKey)) {
118
- const pemKey = _chunkTSW463FIcjs.toPem.call(void 0, rawKey, "PRIVATE KEY");
119
- _assert2.default.call(void 0, ["RSA PRIVATE KEY", "PRIVATE KEY"].indexOf(_chunkTSW463FIcjs.identifyPemType.call(void 0, pemKey)) >= 0);
118
+ const pemKey = _chunkR6I4NJSZcjs.toPem.call(void 0, rawKey, "PRIVATE KEY");
119
+ _assert2.default.call(void 0, ["RSA PRIVATE KEY", "PRIVATE KEY"].indexOf(_chunkR6I4NJSZcjs.identifyPemType.call(void 0, pemKey)) >= 0);
120
120
  return { hidden: pemKey };
121
121
  }
122
122
  return { hidden: ensureTrailingLF(rawKey) };
@@ -145,28 +145,28 @@ async function readPrivateKeyAsync(filename) {
145
145
  if (filename.match(/.*\.der/)) {
146
146
  return myCreatePrivateKey(buf);
147
147
  }
148
- return myCreatePrivateKey(_chunkTSW463FIcjs.removeTrailingLF.call(void 0, buf.toString("utf-8")));
148
+ return myCreatePrivateKey(_chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, buf.toString("utf-8")));
149
149
  }
150
150
  function readCertificatePEM(filename) {
151
151
  return _readPemFile(filename);
152
152
  }
153
153
  async function readCertificatePEMAsync(filename) {
154
154
  const buf = await _fs2.default.promises.readFile(filename, "utf-8");
155
- return _chunkTSW463FIcjs.removeTrailingLF.call(void 0, buf);
155
+ return _chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, buf);
156
156
  }
157
157
  function readPublicKeyPEM(filename) {
158
158
  return _readPemFile(filename);
159
159
  }
160
160
  async function readPublicKeyPEMAsync(filename) {
161
161
  const buf = await _fs2.default.promises.readFile(filename, "utf-8");
162
- return _chunkTSW463FIcjs.removeTrailingLF.call(void 0, buf);
162
+ return _chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, buf);
163
163
  }
164
164
  function readPrivateKeyPEM(filename) {
165
165
  return _readPemFile(filename);
166
166
  }
167
167
  async function readPrivateKeyPEMAsync(filename) {
168
168
  const buf = await _fs2.default.promises.readFile(filename, "utf-8");
169
- return _chunkTSW463FIcjs.removeTrailingLF.call(void 0, buf);
169
+ return _chunkR6I4NJSZcjs.removeTrailingLF.call(void 0, buf);
170
170
  }
171
171
  var _g_certificate_store = "";
172
172
  function setCertificateStore(store) {
@@ -211,7 +211,7 @@ async function readCertificateRevocationList(filename) {
211
211
  return crl;
212
212
  }
213
213
  const raw_crl = crl.toString();
214
- return _chunkTSW463FIcjs.convertPEMtoDER.call(void 0, raw_crl);
214
+ return _chunkR6I4NJSZcjs.convertPEMtoDER.call(void 0, raw_crl);
215
215
  }
216
216
 
217
217
  // source_nodejs/read_certificate_signing_request.ts
@@ -222,14 +222,14 @@ async function readCertificateSigningRequest(filename) {
222
222
  return csr;
223
223
  }
224
224
  const raw_crl = csr.toString();
225
- return _chunkTSW463FIcjs.convertPEMtoDER.call(void 0, raw_crl);
225
+ return _chunkR6I4NJSZcjs.convertPEMtoDER.call(void 0, raw_crl);
226
226
  }
227
227
 
228
228
  // source_nodejs/write.ts
229
229
 
230
230
  function certificatesToPem(certificates) {
231
231
  const certs = Array.isArray(certificates) ? certificates : [certificates];
232
- return `${certs.map((der) => _chunkTSW463FIcjs.toPem.call(void 0, der, "CERTIFICATE")).join("\n")}
232
+ return `${certs.map((der) => _chunkR6I4NJSZcjs.toPem.call(void 0, der, "CERTIFICATE")).join("\n")}
233
233
  `;
234
234
  }
235
235
  function writeCertificateChain(filename, certificates) {
@@ -240,7 +240,7 @@ async function writeCertificateChainAsync(filename, certificates) {
240
240
  }
241
241
  function certificatesToDer(certificates) {
242
242
  const certs = Array.isArray(certificates) ? certificates : [certificates];
243
- return _chunkTSW463FIcjs.combine_der.call(void 0, certs);
243
+ return _chunkR6I4NJSZcjs.combine_der.call(void 0, certs);
244
244
  }
245
245
  function writeCertificateChainDer(filename, certificates) {
246
246
  _fs2.default.writeFileSync(filename, certificatesToDer(certificates));
@@ -279,4 +279,4 @@ async function writeCertificateChainDerAsync(filename, certificates) {
279
279
 
280
280
 
281
281
  exports.generatePrivateKeyFile = generatePrivateKeyFile; exports.generatePrivateKeyFileAlternate = generatePrivateKeyFileAlternate; exports.readCertificate = readCertificate; exports.readCertificateChain = readCertificateChain; exports.readCertificateChainAsync = readCertificateChainAsync; exports.readCertificateAsync = readCertificateAsync; exports.readPublicKey = readPublicKey; exports.readPublicKeyAsync = readPublicKeyAsync; exports.readPrivateKey = readPrivateKey; exports.readPrivateKeyAsync = readPrivateKeyAsync; exports.readCertificatePEM = readCertificatePEM; exports.readCertificatePEMAsync = readCertificatePEMAsync; exports.readPublicKeyPEM = readPublicKeyPEM; exports.readPublicKeyPEMAsync = readPublicKeyPEMAsync; exports.readPrivateKeyPEM = readPrivateKeyPEM; exports.readPrivateKeyPEMAsync = readPrivateKeyPEMAsync; exports.setCertificateStore = setCertificateStore; exports.getCertificateStore = getCertificateStore; exports.readPrivateRsaKey = readPrivateRsaKey; exports.readPublicRsaKey = readPublicRsaKey; exports.readCertificateRevocationList = readCertificateRevocationList; exports.readCertificateSigningRequest = readCertificateSigningRequest; exports.certificatesToPem = certificatesToPem; exports.writeCertificateChain = writeCertificateChain; exports.writeCertificateChainAsync = writeCertificateChainAsync; exports.certificatesToDer = certificatesToDer; exports.writeCertificateChainDer = writeCertificateChainDer; exports.writeCertificateChainDerAsync = writeCertificateChainDerAsync;
282
- //# sourceMappingURL=chunk-IKQT3ICS.cjs.map
282
+ //# sourceMappingURL=chunk-XJHDKGLH.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/chunk-IKQT3ICS.cjs","../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"],"names":["fs"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACYA,gCAAoC;AACpC,gEAAe;AAEf,MAAA,SAAsB,sBAAA,CAAuB,kBAAA,EAA4B,aAAA,EAA0C;AAC/G,EAAA,MAAM,KAAA,EAAO,MAAM,+CAAA,aAA6B,CAAA;AAChD,EAAA,MAAM,cAAA,EAAgB,MAAM,+CAAA,IAAgB,CAAK,UAAU,CAAA;AAC3D,EAAA,MAAM,YAAA,CAAG,QAAA,CAAS,SAAA,CAAU,kBAAA,EAAoB,aAAA,CAAc,OAAA,EAAS,OAAO,CAAA;AAC9E,EAAA,aAAA,CAAc,QAAA,EAAU,EAAA;AACxB,EAAA,aAAA,CAAc,QAAA,EAAU,IAAI,WAAA,CAAY,CAAC,CAAA;AAC7C;AAQA,MAAA,SAAsB,+BAAA,CAAgC,kBAAA,EAA4B,aAAA,EAAmC;AACjH,EAAA,MAAM,EAAE,WAAW,EAAA,EAAI,yCAAA,KAAoB,EAAO;AAAA,IAC9C,aAAA;AAAA,IACA,kBAAA,EAAoB,EAAE,IAAA,EAAM,OAAA,EAAS,MAAA,EAAQ,MAAM,CAAA;AAAA,IACnD,iBAAA,EAAmB,EAAE,IAAA,EAAM,MAAA,EAAQ,MAAA,EAAQ,MAAM;AAAA,EACrD,CAAC,CAAA;AACD,EAAA,MAAM,YAA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K,EAAA;AAChB,EAAA;AACX;AAC8C;AACf,EAAA;AACK,IAAA;AAChC,EAAA;AACO,EAAA;AACX;AAKkC;AACP,EAAA;AACH,IAAA;AACpB,EAAA;AACiC,EAAA;AACR,IAAA;AACzB,EAAA;AACgC,EAAA;AACX,EAAA;AACO,EAAA;AACI,EAAA;AAChB,EAAA;AACpB;AAEiC;AACI,EAAA;AACR,IAAA;AACzB,EAAA;AACgC,EAAA;AACF,EAAA;AACF,EAAA;AACK,EAAA;AACrC;AF1GmC;AACA;AGtLpB;AAIO;AACY,EAAA;AACI,EAAA;AAEvB,IAAA;AACX,EAAA;AAC6B,EAAA;AACC,EAAA;AAClC;AHoLmC;AACA;AIjMpB;AAMO;AACY,EAAA;AACI,EAAA;AAEvB,IAAA;AACX,EAAA;AAC6B,EAAA;AACC,EAAA;AAClC;AJ6LmC;AACA;AK5MpB;AAemB;AACF,EAAA;AACC,EAAA;AAAqC;AACtE;AAQsC;AACP,EAAA;AAC/B;AAKsB;AACU,EAAA;AAChC;AAUkC;AACF,EAAA;AACJ,EAAA;AAC5B;AAQyC;AACV,EAAA;AAC/B;AAKsB;AACU,EAAA;AAChC;ALkKmC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/chunk-IKQT3ICS.cjs","sourcesContent":[null,"// ---------------------------------------------------------------------------------------------------------------------\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"]}
1
+ {"version":3,"sources":["/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/chunk-XJHDKGLH.cjs","../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"],"names":["fs"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACYA,gCAAoC;AACpC,gEAAe;AAEf,MAAA,SAAsB,sBAAA,CAAuB,kBAAA,EAA4B,aAAA,EAA0C;AAC/G,EAAA,MAAM,KAAA,EAAO,MAAM,+CAAA,aAA6B,CAAA;AAChD,EAAA,MAAM,cAAA,EAAgB,MAAM,+CAAA,IAAgB,CAAK,UAAU,CAAA;AAC3D,EAAA,MAAM,YAAA,CAAG,QAAA,CAAS,SAAA,CAAU,kBAAA,EAAoB,aAAA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/node-opcua-crypto/node-opcua-crypto/packages/node-opcua-crypto/dist/chunk-XJHDKGLH.cjs","sourcesContent":[null,"// ---------------------------------------------------------------------------------------------------------------------\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"]}
package/dist/index.cjs CHANGED
@@ -27,7 +27,7 @@
27
27
 
28
28
 
29
29
 
30
- var _chunkIKQT3ICScjs = require('./chunk-IKQT3ICS.cjs');
30
+ var _chunkXJHDKGLHcjs = require('./chunk-XJHDKGLH.cjs');
31
31
 
32
32
 
33
33
 
@@ -106,7 +106,7 @@ var _chunkIKQT3ICScjs = require('./chunk-IKQT3ICS.cjs');
106
106
 
107
107
 
108
108
 
109
- var _chunkTSW463FIcjs = require('./chunk-TSW463FI.cjs');
109
+ var _chunkR6I4NJSZcjs = require('./chunk-R6I4NJSZ.cjs');
110
110
 
111
111
 
112
112
 
@@ -213,5 +213,5 @@ var _chunkTSW463FIcjs = require('./chunk-TSW463FI.cjs');
213
213
 
214
214
 
215
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;
216
+ exports.CertificatePurpose = _chunkR6I4NJSZcjs.CertificatePurpose; exports.PaddingAlgorithm = _chunkR6I4NJSZcjs.PaddingAlgorithm; exports.RSA_PKCS1_OAEP_PADDING = _chunkR6I4NJSZcjs.RSA_PKCS1_OAEP_PADDING; exports.RSA_PKCS1_PADDING = _chunkR6I4NJSZcjs.RSA_PKCS1_PADDING; exports.Subject = _chunkR6I4NJSZcjs.Subject; exports._coercePrivateKey = _chunkR6I4NJSZcjs._coercePrivateKey; exports.asn1 = _chunkR6I4NJSZcjs.asn1; exports.certificateMatchesPrivateKey = _chunkR6I4NJSZcjs.certificateMatchesPrivateKey; exports.certificatesToDer = _chunkXJHDKGLHcjs.certificatesToDer; exports.certificatesToPem = _chunkXJHDKGLHcjs.certificatesToPem; exports.clearExploreCertificateCache = _chunkR6I4NJSZcjs.clearExploreCertificateCache; exports.coerceCertificate = _chunkR6I4NJSZcjs.coerceCertificate; exports.coerceCertificatePem = _chunkR6I4NJSZcjs.coerceCertificatePem; exports.coercePEMorDerToPrivateKey = _chunkR6I4NJSZcjs.coercePEMorDerToPrivateKey; exports.coercePrivateKeyPem = _chunkR6I4NJSZcjs.coercePrivateKeyPem; exports.coercePublicKeyPem = _chunkR6I4NJSZcjs.coercePublicKeyPem; exports.coerceRsaPublicKeyPem = _chunkR6I4NJSZcjs.coerceRsaPublicKeyPem; exports.combine_der = _chunkR6I4NJSZcjs.combine_der; exports.computeDerivedKeys = _chunkR6I4NJSZcjs.computeDerivedKeys; exports.computePaddingFooter = _chunkR6I4NJSZcjs.computePaddingFooter; exports.convertPEMtoDER = _chunkR6I4NJSZcjs.convertPEMtoDER; exports.createCertificateSigningRequest = _chunkR6I4NJSZcjs.createCertificateSigningRequest; exports.createPrivateKeyFromNodeJSCrypto = _chunkR6I4NJSZcjs.createPrivateKeyFromNodeJSCrypto; exports.createSelfSignedCertificate = _chunkR6I4NJSZcjs.createSelfSignedCertificate; exports.decryptBufferWithDerivedKeys = _chunkR6I4NJSZcjs.decryptBufferWithDerivedKeys; exports.derToPrivateKey = _chunkR6I4NJSZcjs.derToPrivateKey; exports.encryptBufferWithDerivedKeys = _chunkR6I4NJSZcjs.encryptBufferWithDerivedKeys; exports.exploreAsn1 = _chunkR6I4NJSZcjs.exploreAsn1; exports.exploreCertificate = _chunkR6I4NJSZcjs.exploreCertificate; exports.exploreCertificateInfo = _chunkR6I4NJSZcjs.exploreCertificateInfo; exports.exploreCertificateRevocationList = _chunkR6I4NJSZcjs.exploreCertificateRevocationList; exports.exploreCertificateSigningRequest = _chunkR6I4NJSZcjs.exploreCertificateSigningRequest; exports.explorePrivateKey = _chunkR6I4NJSZcjs.explorePrivateKey; exports.extractPublicKeyFromCertificate = _chunkR6I4NJSZcjs.extractPublicKeyFromCertificate; exports.extractPublicKeyFromCertificateSync = _chunkR6I4NJSZcjs.extractPublicKeyFromCertificateSync; exports.generateKeyPair = _chunkR6I4NJSZcjs.generateKeyPair; exports.generatePrivateKey = _chunkR6I4NJSZcjs.generatePrivateKey; exports.generatePrivateKeyFile = _chunkXJHDKGLHcjs.generatePrivateKeyFile; exports.generatePrivateKeyFileAlternate = _chunkXJHDKGLHcjs.generatePrivateKeyFileAlternate; exports.getCertificateStore = _chunkXJHDKGLHcjs.getCertificateStore; exports.hexDump = _chunkR6I4NJSZcjs.hexDump; exports.identifyDERContent = _chunkR6I4NJSZcjs.identifyDERContent; exports.identifyPemType = _chunkR6I4NJSZcjs.identifyPemType; exports.isCrlIssuedByCertificate = _chunkR6I4NJSZcjs.isCrlIssuedByCertificate; exports.isKeyObject = _chunkR6I4NJSZcjs.isKeyObject; exports.makeMessageChunkSignature = _chunkR6I4NJSZcjs.makeMessageChunkSignature; exports.makeMessageChunkSignatureWithDerivedKeys = _chunkR6I4NJSZcjs.makeMessageChunkSignatureWithDerivedKeys; exports.makePrivateKeyFromPem = _chunkR6I4NJSZcjs.makePrivateKeyFromPem; exports.makePrivateKeyThumbPrint = _chunkR6I4NJSZcjs.makePrivateKeyThumbPrint; exports.makePseudoRandomBuffer = _chunkR6I4NJSZcjs.makePseudoRandomBuffer; exports.makeSHA1Thumbprint = _chunkR6I4NJSZcjs.makeSHA1Thumbprint; exports.pemToPrivateKey = _chunkR6I4NJSZcjs.pemToPrivateKey; exports.privateDecrypt = _chunkR6I4NJSZcjs.privateDecrypt; exports.privateDecrypt_long = _chunkR6I4NJSZcjs.privateDecrypt_long; exports.privateDecrypt_native = _chunkR6I4NJSZcjs.privateDecrypt_native; exports.privateKeyToPEM = _chunkR6I4NJSZcjs.privateKeyToPEM; exports.publicEncrypt = _chunkR6I4NJSZcjs.publicEncrypt; exports.publicEncrypt_long = _chunkR6I4NJSZcjs.publicEncrypt_long; exports.publicEncrypt_native = _chunkR6I4NJSZcjs.publicEncrypt_native; exports.publicKeyAndPrivateKeyMatches = _chunkR6I4NJSZcjs.publicKeyAndPrivateKeyMatches; exports.readCertificate = _chunkXJHDKGLHcjs.readCertificate; exports.readCertificateAsync = _chunkXJHDKGLHcjs.readCertificateAsync; exports.readCertificateChain = _chunkXJHDKGLHcjs.readCertificateChain; exports.readCertificateChainAsync = _chunkXJHDKGLHcjs.readCertificateChainAsync; exports.readCertificatePEM = _chunkXJHDKGLHcjs.readCertificatePEM; exports.readCertificatePEMAsync = _chunkXJHDKGLHcjs.readCertificatePEMAsync; exports.readCertificateRevocationList = _chunkXJHDKGLHcjs.readCertificateRevocationList; exports.readCertificateSigningRequest = _chunkXJHDKGLHcjs.readCertificateSigningRequest; exports.readCertificationRequestInfo = _chunkR6I4NJSZcjs.readCertificationRequestInfo; exports.readExtension = _chunkR6I4NJSZcjs.readExtension; exports.readNameForCrl = _chunkR6I4NJSZcjs.readNameForCrl; exports.readPrivateKey = _chunkXJHDKGLHcjs.readPrivateKey; exports.readPrivateKeyAsync = _chunkXJHDKGLHcjs.readPrivateKeyAsync; exports.readPrivateKeyPEM = _chunkXJHDKGLHcjs.readPrivateKeyPEM; exports.readPrivateKeyPEMAsync = _chunkXJHDKGLHcjs.readPrivateKeyPEMAsync; exports.readPrivateRsaKey = _chunkXJHDKGLHcjs.readPrivateRsaKey; exports.readPublicKey = _chunkXJHDKGLHcjs.readPublicKey; exports.readPublicKeyAsync = _chunkXJHDKGLHcjs.readPublicKeyAsync; exports.readPublicKeyPEM = _chunkXJHDKGLHcjs.readPublicKeyPEM; exports.readPublicKeyPEMAsync = _chunkXJHDKGLHcjs.readPublicKeyPEMAsync; exports.readPublicRsaKey = _chunkXJHDKGLHcjs.readPublicRsaKey; exports.readTbsCertificate = _chunkR6I4NJSZcjs.readTbsCertificate; exports.reduceLength = _chunkR6I4NJSZcjs.reduceLength; exports.removePadding = _chunkR6I4NJSZcjs.removePadding; exports.removeTrailingLF = _chunkR6I4NJSZcjs.removeTrailingLF; exports.rsaLengthPrivateKey = _chunkR6I4NJSZcjs.rsaLengthPrivateKey; exports.rsaLengthPublicKey = _chunkR6I4NJSZcjs.rsaLengthPublicKey; exports.rsaLengthRsaPublicKey = _chunkR6I4NJSZcjs.rsaLengthRsaPublicKey; exports.setCertificateStore = _chunkXJHDKGLHcjs.setCertificateStore; exports.split_der = _chunkR6I4NJSZcjs.split_der; exports.toPem = _chunkR6I4NJSZcjs.toPem; exports.toPem2 = _chunkR6I4NJSZcjs.toPem2; exports.verifyCertificateChain = _chunkR6I4NJSZcjs.verifyCertificateChain; exports.verifyCertificateOrClrSignature = _chunkR6I4NJSZcjs.verifyCertificateOrClrSignature; exports.verifyCertificateRevocationListSignature = _chunkR6I4NJSZcjs.verifyCertificateRevocationListSignature; exports.verifyCertificateSignature = _chunkR6I4NJSZcjs.verifyCertificateSignature; exports.verifyChunkSignature = _chunkR6I4NJSZcjs.verifyChunkSignature; exports.verifyChunkSignatureWithDerivedKeys = _chunkR6I4NJSZcjs.verifyChunkSignatureWithDerivedKeys; exports.verifyCrlIssuedByCertificate = _chunkR6I4NJSZcjs.verifyCrlIssuedByCertificate; exports.verifyMessageChunkSignature = _chunkR6I4NJSZcjs.verifyMessageChunkSignature; exports.verify_certificate_der_structure = _chunkR6I4NJSZcjs.verify_certificate_der_structure; exports.writeCertificateChain = _chunkXJHDKGLHcjs.writeCertificateChain; exports.writeCertificateChainAsync = _chunkXJHDKGLHcjs.writeCertificateChainAsync; exports.writeCertificateChainDer = _chunkXJHDKGLHcjs.writeCertificateChainDer; exports.writeCertificateChainDerAsync = _chunkXJHDKGLHcjs.writeCertificateChainDerAsync;
217
217
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  writeCertificateChainAsync,
28
28
  writeCertificateChainDer,
29
29
  writeCertificateChainDerAsync
30
- } from "./chunk-UEEZA3YS.js";
30
+ } from "./chunk-DC5KIPR2.js";
31
31
  import {
32
32
  CertificatePurpose,
33
33
  PaddingAlgorithm,
@@ -106,7 +106,7 @@ import {
106
106
  verifyCrlIssuedByCertificate,
107
107
  verifyMessageChunkSignature,
108
108
  verify_certificate_der_structure
109
- } from "./chunk-ODR4HUB7.js";
109
+ } from "./chunk-MFGOTDMX.js";
110
110
  export {
111
111
  CertificatePurpose,
112
112
  PaddingAlgorithm,
@@ -76,7 +76,7 @@
76
76
 
77
77
 
78
78
 
79
- var _chunkTSW463FIcjs = require('../chunk-TSW463FI.cjs');
79
+ var _chunkR6I4NJSZcjs = require('../chunk-R6I4NJSZ.cjs');
80
80
 
81
81
 
82
82
 
@@ -155,5 +155,5 @@ var _chunkTSW463FIcjs = require('../chunk-TSW463FI.cjs');
155
155
 
156
156
 
157
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;
158
+ exports.CertificatePurpose = _chunkR6I4NJSZcjs.CertificatePurpose; exports.PaddingAlgorithm = _chunkR6I4NJSZcjs.PaddingAlgorithm; exports.RSA_PKCS1_OAEP_PADDING = _chunkR6I4NJSZcjs.RSA_PKCS1_OAEP_PADDING; exports.RSA_PKCS1_PADDING = _chunkR6I4NJSZcjs.RSA_PKCS1_PADDING; exports.Subject = _chunkR6I4NJSZcjs.Subject; exports._coercePrivateKey = _chunkR6I4NJSZcjs._coercePrivateKey; exports.asn1 = _chunkR6I4NJSZcjs.asn1; exports.certificateMatchesPrivateKey = _chunkR6I4NJSZcjs.certificateMatchesPrivateKey; exports.clearExploreCertificateCache = _chunkR6I4NJSZcjs.clearExploreCertificateCache; exports.coerceCertificate = _chunkR6I4NJSZcjs.coerceCertificate; exports.coerceCertificatePem = _chunkR6I4NJSZcjs.coerceCertificatePem; exports.coercePEMorDerToPrivateKey = _chunkR6I4NJSZcjs.coercePEMorDerToPrivateKey; exports.coercePrivateKeyPem = _chunkR6I4NJSZcjs.coercePrivateKeyPem; exports.coercePublicKeyPem = _chunkR6I4NJSZcjs.coercePublicKeyPem; exports.coerceRsaPublicKeyPem = _chunkR6I4NJSZcjs.coerceRsaPublicKeyPem; exports.combine_der = _chunkR6I4NJSZcjs.combine_der; exports.computeDerivedKeys = _chunkR6I4NJSZcjs.computeDerivedKeys; exports.computePaddingFooter = _chunkR6I4NJSZcjs.computePaddingFooter; exports.convertPEMtoDER = _chunkR6I4NJSZcjs.convertPEMtoDER; exports.createCertificateSigningRequest = _chunkR6I4NJSZcjs.createCertificateSigningRequest; exports.createPrivateKeyFromNodeJSCrypto = _chunkR6I4NJSZcjs.createPrivateKeyFromNodeJSCrypto; exports.createSelfSignedCertificate = _chunkR6I4NJSZcjs.createSelfSignedCertificate; exports.decryptBufferWithDerivedKeys = _chunkR6I4NJSZcjs.decryptBufferWithDerivedKeys; exports.derToPrivateKey = _chunkR6I4NJSZcjs.derToPrivateKey; exports.encryptBufferWithDerivedKeys = _chunkR6I4NJSZcjs.encryptBufferWithDerivedKeys; exports.exploreAsn1 = _chunkR6I4NJSZcjs.exploreAsn1; exports.exploreCertificate = _chunkR6I4NJSZcjs.exploreCertificate; exports.exploreCertificateInfo = _chunkR6I4NJSZcjs.exploreCertificateInfo; exports.exploreCertificateRevocationList = _chunkR6I4NJSZcjs.exploreCertificateRevocationList; exports.exploreCertificateSigningRequest = _chunkR6I4NJSZcjs.exploreCertificateSigningRequest; exports.explorePrivateKey = _chunkR6I4NJSZcjs.explorePrivateKey; exports.extractPublicKeyFromCertificate = _chunkR6I4NJSZcjs.extractPublicKeyFromCertificate; exports.extractPublicKeyFromCertificateSync = _chunkR6I4NJSZcjs.extractPublicKeyFromCertificateSync; exports.generateKeyPair = _chunkR6I4NJSZcjs.generateKeyPair; exports.generatePrivateKey = _chunkR6I4NJSZcjs.generatePrivateKey; exports.hexDump = _chunkR6I4NJSZcjs.hexDump; exports.identifyDERContent = _chunkR6I4NJSZcjs.identifyDERContent; exports.identifyPemType = _chunkR6I4NJSZcjs.identifyPemType; exports.isCrlIssuedByCertificate = _chunkR6I4NJSZcjs.isCrlIssuedByCertificate; exports.isKeyObject = _chunkR6I4NJSZcjs.isKeyObject; exports.makeMessageChunkSignature = _chunkR6I4NJSZcjs.makeMessageChunkSignature; exports.makeMessageChunkSignatureWithDerivedKeys = _chunkR6I4NJSZcjs.makeMessageChunkSignatureWithDerivedKeys; exports.makePrivateKeyFromPem = _chunkR6I4NJSZcjs.makePrivateKeyFromPem; exports.makePrivateKeyThumbPrint = _chunkR6I4NJSZcjs.makePrivateKeyThumbPrint; exports.makePseudoRandomBuffer = _chunkR6I4NJSZcjs.makePseudoRandomBuffer; exports.makeSHA1Thumbprint = _chunkR6I4NJSZcjs.makeSHA1Thumbprint; exports.pemToPrivateKey = _chunkR6I4NJSZcjs.pemToPrivateKey; exports.privateDecrypt = _chunkR6I4NJSZcjs.privateDecrypt; exports.privateDecrypt_long = _chunkR6I4NJSZcjs.privateDecrypt_long; exports.privateDecrypt_native = _chunkR6I4NJSZcjs.privateDecrypt_native; exports.privateKeyToPEM = _chunkR6I4NJSZcjs.privateKeyToPEM; exports.publicEncrypt = _chunkR6I4NJSZcjs.publicEncrypt; exports.publicEncrypt_long = _chunkR6I4NJSZcjs.publicEncrypt_long; exports.publicEncrypt_native = _chunkR6I4NJSZcjs.publicEncrypt_native; exports.publicKeyAndPrivateKeyMatches = _chunkR6I4NJSZcjs.publicKeyAndPrivateKeyMatches; exports.readCertificationRequestInfo = _chunkR6I4NJSZcjs.readCertificationRequestInfo; exports.readExtension = _chunkR6I4NJSZcjs.readExtension; exports.readNameForCrl = _chunkR6I4NJSZcjs.readNameForCrl; exports.readTbsCertificate = _chunkR6I4NJSZcjs.readTbsCertificate; exports.reduceLength = _chunkR6I4NJSZcjs.reduceLength; exports.removePadding = _chunkR6I4NJSZcjs.removePadding; exports.removeTrailingLF = _chunkR6I4NJSZcjs.removeTrailingLF; exports.rsaLengthPrivateKey = _chunkR6I4NJSZcjs.rsaLengthPrivateKey; exports.rsaLengthPublicKey = _chunkR6I4NJSZcjs.rsaLengthPublicKey; exports.rsaLengthRsaPublicKey = _chunkR6I4NJSZcjs.rsaLengthRsaPublicKey; exports.split_der = _chunkR6I4NJSZcjs.split_der; exports.toPem = _chunkR6I4NJSZcjs.toPem; exports.toPem2 = _chunkR6I4NJSZcjs.toPem2; exports.verifyCertificateChain = _chunkR6I4NJSZcjs.verifyCertificateChain; exports.verifyCertificateOrClrSignature = _chunkR6I4NJSZcjs.verifyCertificateOrClrSignature; exports.verifyCertificateRevocationListSignature = _chunkR6I4NJSZcjs.verifyCertificateRevocationListSignature; exports.verifyCertificateSignature = _chunkR6I4NJSZcjs.verifyCertificateSignature; exports.verifyChunkSignature = _chunkR6I4NJSZcjs.verifyChunkSignature; exports.verifyChunkSignatureWithDerivedKeys = _chunkR6I4NJSZcjs.verifyChunkSignatureWithDerivedKeys; exports.verifyCrlIssuedByCertificate = _chunkR6I4NJSZcjs.verifyCrlIssuedByCertificate; exports.verifyMessageChunkSignature = _chunkR6I4NJSZcjs.verifyMessageChunkSignature; exports.verify_certificate_der_structure = _chunkR6I4NJSZcjs.verify_certificate_der_structure;
159
159
  //# sourceMappingURL=index_web.cjs.map
@@ -76,7 +76,7 @@ import {
76
76
  verifyCrlIssuedByCertificate,
77
77
  verifyMessageChunkSignature,
78
78
  verify_certificate_der_structure
79
- } from "../chunk-ODR4HUB7.js";
79
+ } from "../chunk-MFGOTDMX.js";
80
80
  export {
81
81
  CertificatePurpose,
82
82
  PaddingAlgorithm,
@@ -27,8 +27,8 @@
27
27
 
28
28
 
29
29
 
30
- var _chunkIKQT3ICScjs = require('../chunk-IKQT3ICS.cjs');
31
- require('../chunk-TSW463FI.cjs');
30
+ var _chunkXJHDKGLHcjs = require('../chunk-XJHDKGLH.cjs');
31
+ require('../chunk-R6I4NJSZ.cjs');
32
32
 
33
33
 
34
34
 
@@ -58,5 +58,5 @@ require('../chunk-TSW463FI.cjs');
58
58
 
59
59
 
60
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;
61
+ exports.certificatesToDer = _chunkXJHDKGLHcjs.certificatesToDer; exports.certificatesToPem = _chunkXJHDKGLHcjs.certificatesToPem; exports.generatePrivateKeyFile = _chunkXJHDKGLHcjs.generatePrivateKeyFile; exports.generatePrivateKeyFileAlternate = _chunkXJHDKGLHcjs.generatePrivateKeyFileAlternate; exports.getCertificateStore = _chunkXJHDKGLHcjs.getCertificateStore; exports.readCertificate = _chunkXJHDKGLHcjs.readCertificate; exports.readCertificateAsync = _chunkXJHDKGLHcjs.readCertificateAsync; exports.readCertificateChain = _chunkXJHDKGLHcjs.readCertificateChain; exports.readCertificateChainAsync = _chunkXJHDKGLHcjs.readCertificateChainAsync; exports.readCertificatePEM = _chunkXJHDKGLHcjs.readCertificatePEM; exports.readCertificatePEMAsync = _chunkXJHDKGLHcjs.readCertificatePEMAsync; exports.readCertificateRevocationList = _chunkXJHDKGLHcjs.readCertificateRevocationList; exports.readCertificateSigningRequest = _chunkXJHDKGLHcjs.readCertificateSigningRequest; exports.readPrivateKey = _chunkXJHDKGLHcjs.readPrivateKey; exports.readPrivateKeyAsync = _chunkXJHDKGLHcjs.readPrivateKeyAsync; exports.readPrivateKeyPEM = _chunkXJHDKGLHcjs.readPrivateKeyPEM; exports.readPrivateKeyPEMAsync = _chunkXJHDKGLHcjs.readPrivateKeyPEMAsync; exports.readPrivateRsaKey = _chunkXJHDKGLHcjs.readPrivateRsaKey; exports.readPublicKey = _chunkXJHDKGLHcjs.readPublicKey; exports.readPublicKeyAsync = _chunkXJHDKGLHcjs.readPublicKeyAsync; exports.readPublicKeyPEM = _chunkXJHDKGLHcjs.readPublicKeyPEM; exports.readPublicKeyPEMAsync = _chunkXJHDKGLHcjs.readPublicKeyPEMAsync; exports.readPublicRsaKey = _chunkXJHDKGLHcjs.readPublicRsaKey; exports.setCertificateStore = _chunkXJHDKGLHcjs.setCertificateStore; exports.writeCertificateChain = _chunkXJHDKGLHcjs.writeCertificateChain; exports.writeCertificateChainAsync = _chunkXJHDKGLHcjs.writeCertificateChainAsync; exports.writeCertificateChainDer = _chunkXJHDKGLHcjs.writeCertificateChainDer; exports.writeCertificateChainDerAsync = _chunkXJHDKGLHcjs.writeCertificateChainDerAsync;
62
62
  //# sourceMappingURL=index.cjs.map
@@ -27,8 +27,8 @@ import {
27
27
  writeCertificateChainAsync,
28
28
  writeCertificateChainDer,
29
29
  writeCertificateChainDerAsync
30
- } from "../chunk-UEEZA3YS.js";
31
- import "../chunk-ODR4HUB7.js";
30
+ } from "../chunk-DC5KIPR2.js";
31
+ import "../chunk-MFGOTDMX.js";
32
32
  export {
33
33
  certificatesToDer,
34
34
  certificatesToPem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-crypto",
3
- "version": "5.3.2",
3
+ "version": "5.3.3",
4
4
  "type": "module",
5
5
  "description": "Crypto tools for Node-OPCUA",
6
6
  "types": "./dist/index.d.ts",
@@ -72,6 +72,7 @@
72
72
  "dependencies": {
73
73
  "@peculiar/webcrypto": "^1.5.0",
74
74
  "@peculiar/x509": "^2.0.0",
75
+ "reflect-metadata": "^0.2.2",
75
76
  "sshpk": "^1.18.0"
76
77
  },
77
78
  "repository": {
@@ -86,5 +87,5 @@
86
87
  "LICENSE",
87
88
  "README.md"
88
89
  ],
89
- "gitHead": "ddf7780fd57e6babfd9df320c8d50a8d2f9a8a6a"
90
+ "gitHead": "139654a77f35f0a91a834c046b47dd7adc30aaee"
90
91
  }