node-opcua-crypto 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/dist/chunk-5NV4OKIV.mjs +1 -0
  4. package/dist/chunk-KPKFYTZJ.mjs +173 -0
  5. package/dist/chunk-QSSIRHMR.mjs +6243 -0
  6. package/dist/index.js +6521 -0
  7. package/dist/index.mjs +224 -0
  8. package/dist/source/index.js +6346 -0
  9. package/dist/source/index.mjs +192 -0
  10. package/dist/source/index_web.js +6346 -0
  11. package/dist/source/index_web.mjs +191 -0
  12. package/dist/source_nodejs/index.js +4170 -0
  13. package/dist/source_nodejs/index.mjs +37 -0
  14. package/dist-types/index.d.ts +2 -0
  15. package/dist-types/source/common.d.ts +21 -1
  16. package/dist-types/source/crypto_utils2.d.ts +2 -3
  17. package/dist-types/source/make_private_key_from_pem.d.ts +1 -1
  18. package/dist-types/source/x509/coerce_private_key.d.ts +5 -3
  19. package/dist-types/source/x509/create_key_pair.d.ts +6 -0
  20. package/dist-types/source/x509/create_self_signed_certificate.d.ts +4 -0
  21. package/dist-types/source_nodejs/read.d.ts +1 -0
  22. package/doc/.nojekyll +1 -0
  23. package/doc/assets/highlight.css +71 -0
  24. package/doc/assets/main.js +58 -0
  25. package/doc/assets/search.js +1 -0
  26. package/doc/assets/style.css +1379 -0
  27. package/doc/classes/Subject.html +76 -0
  28. package/doc/functions/combine_der.html +80 -0
  29. package/doc/functions/createPrivateKeyFromNodeJSCrypto.html +81 -0
  30. package/doc/functions/createSelfSignedCertificate.html +76 -0
  31. package/doc/functions/exploreCertificate.html +77 -0
  32. package/doc/functions/exploreCertificateInfo.html +80 -0
  33. package/doc/functions/explorePrivateKey.html +74 -0
  34. package/doc/functions/extractPublicKeyFromCertificate.html +92 -0
  35. package/doc/functions/generatePrivateKey.html +76 -0
  36. package/doc/functions/generatePrivateKeyFileAlternate.html +79 -0
  37. package/doc/functions/makeMessageChunkSignatureWithDerivedKeys.html +78 -0
  38. package/doc/functions/privateKeyToPEM.html +76 -0
  39. package/doc/functions/readCertificate.html +76 -0
  40. package/doc/functions/readPrivateKey.html +76 -0
  41. package/doc/functions/readPrivateKeyPEM.html +75 -0
  42. package/doc/functions/readPrivateRsaKey.html +74 -0
  43. package/doc/functions/readPublicKey.html +76 -0
  44. package/doc/functions/reduceLength.html +79 -0
  45. package/doc/functions/removePadding.html +77 -0
  46. package/doc/functions/rsaLengthPrivateKey.html +80 -0
  47. package/doc/functions/split_der.html +80 -0
  48. package/doc/functions/toPem2.html +80 -0
  49. package/doc/functions/verifyChunkSignature.html +82 -0
  50. package/doc/functions/verifyChunkSignatureWithDerivedKeys.html +78 -0
  51. package/doc/functions/verifyMessageChunkSignature.html +83 -0
  52. package/doc/index.html +128 -0
  53. package/doc/interfaces/CertificateInfo.html +135 -0
  54. package/doc/modules.html +96 -0
  55. package/node-opcua-crypto-4.2.0.tgz +0 -0
  56. package/package.json +84 -91
  57. package/dist-cjs/source/asn1.js +0 -304
  58. package/dist-cjs/source/asn1.js.map +0 -1
  59. package/dist-cjs/source/buffer_utils.js +0 -9
  60. package/dist-cjs/source/buffer_utils.js.map +0 -1
  61. package/dist-cjs/source/common.js +0 -11
  62. package/dist-cjs/source/common.js.map +0 -1
  63. package/dist-cjs/source/crypto_explore_certificate.js +0 -367
  64. package/dist-cjs/source/crypto_explore_certificate.js.map +0 -1
  65. package/dist-cjs/source/crypto_utils.js +0 -200
  66. package/dist-cjs/source/crypto_utils.js.map +0 -1
  67. package/dist-cjs/source/crypto_utils2.js +0 -71
  68. package/dist-cjs/source/crypto_utils2.js.map +0 -1
  69. package/dist-cjs/source/derived_keys.js +0 -133
  70. package/dist-cjs/source/derived_keys.js.map +0 -1
  71. package/dist-cjs/source/explore_certificate.js +0 -37
  72. package/dist-cjs/source/explore_certificate.js.map +0 -1
  73. package/dist-cjs/source/explore_certificate_revocation_list.js +0 -69
  74. package/dist-cjs/source/explore_certificate_revocation_list.js.map +0 -1
  75. package/dist-cjs/source/explore_certificate_signing_request.js +0 -45
  76. package/dist-cjs/source/explore_certificate_signing_request.js.map +0 -1
  77. package/dist-cjs/source/explore_private_key.js +0 -77
  78. package/dist-cjs/source/explore_private_key.js.map +0 -1
  79. package/dist-cjs/source/index.js +0 -38
  80. package/dist-cjs/source/index.js.map +0 -1
  81. package/dist-cjs/source/make_private_key_from_pem.js +0 -8
  82. package/dist-cjs/source/make_private_key_from_pem.js.map +0 -1
  83. package/dist-cjs/source/oid_map.js +0 -300
  84. package/dist-cjs/source/oid_map.js.map +0 -1
  85. package/dist-cjs/source/public_private_match.js +0 -32
  86. package/dist-cjs/source/public_private_match.js.map +0 -1
  87. package/dist-cjs/source/subject.js +0 -92
  88. package/dist-cjs/source/subject.js.map +0 -1
  89. package/dist-cjs/source/verify_certificate_signature.js +0 -117
  90. package/dist-cjs/source/verify_certificate_signature.js.map +0 -1
  91. package/dist-cjs/source/x509/_build_public_key.js +0 -69
  92. package/dist-cjs/source/x509/_build_public_key.js.map +0 -1
  93. package/dist-cjs/source/x509/_crypto.js +0 -52
  94. package/dist-cjs/source/x509/_crypto.js.map +0 -1
  95. package/dist-cjs/source/x509/_get_attributes.js +0 -39
  96. package/dist-cjs/source/x509/_get_attributes.js.map +0 -1
  97. package/dist-cjs/source/x509/coerce_private_key.js +0 -90
  98. package/dist-cjs/source/x509/coerce_private_key.js.map +0 -1
  99. package/dist-cjs/source/x509/create_certificate_signing_request.js +0 -92
  100. package/dist-cjs/source/x509/create_certificate_signing_request.js.map +0 -1
  101. package/dist-cjs/source/x509/create_key_pair.js +0 -123
  102. package/dist-cjs/source/x509/create_key_pair.js.map +0 -1
  103. package/dist-cjs/source/x509/create_self_signed_certificate.js +0 -103
  104. package/dist-cjs/source/x509/create_self_signed_certificate.js.map +0 -1
  105. package/dist-cjs/source_nodejs/generate_private_key_filename.js +0 -88
  106. package/dist-cjs/source_nodejs/generate_private_key_filename.js.map +0 -1
  107. package/dist-cjs/source_nodejs/index.js +0 -21
  108. package/dist-cjs/source_nodejs/index.js.map +0 -1
  109. package/dist-cjs/source_nodejs/read.js +0 -115
  110. package/dist-cjs/source_nodejs/read.js.map +0 -1
  111. package/dist-cjs/source_nodejs/read_certificate_revocation_list.js +0 -64
  112. package/dist-cjs/source_nodejs/read_certificate_revocation_list.js.map +0 -1
  113. package/dist-cjs/source_nodejs/read_certificate_signing_request.js +0 -64
  114. package/dist-cjs/source_nodejs/read_certificate_signing_request.js.map +0 -1
  115. package/dist-esm/source/asn1.js +0 -275
  116. package/dist-esm/source/asn1.js.map +0 -1
  117. package/dist-esm/source/buffer_utils.js +0 -6
  118. package/dist-esm/source/buffer_utils.js.map +0 -1
  119. package/dist-esm/source/common.js +0 -8
  120. package/dist-esm/source/common.js.map +0 -1
  121. package/dist-esm/source/crypto_explore_certificate.js +0 -356
  122. package/dist-esm/source/crypto_explore_certificate.js.map +0 -1
  123. package/dist-esm/source/crypto_utils.js +0 -179
  124. package/dist-esm/source/crypto_utils.js.map +0 -1
  125. package/dist-esm/source/crypto_utils2.js +0 -58
  126. package/dist-esm/source/crypto_utils2.js.map +0 -1
  127. package/dist-esm/source/derived_keys.js +0 -117
  128. package/dist-esm/source/derived_keys.js.map +0 -1
  129. package/dist-esm/source/explore_certificate.js +0 -29
  130. package/dist-esm/source/explore_certificate.js.map +0 -1
  131. package/dist-esm/source/explore_certificate_revocation_list.js +0 -64
  132. package/dist-esm/source/explore_certificate_revocation_list.js.map +0 -1
  133. package/dist-esm/source/explore_certificate_signing_request.js +0 -40
  134. package/dist-esm/source/explore_certificate_signing_request.js.map +0 -1
  135. package/dist-esm/source/explore_private_key.js +0 -73
  136. package/dist-esm/source/explore_private_key.js.map +0 -1
  137. package/dist-esm/source/index.js +0 -19
  138. package/dist-esm/source/index.js.map +0 -1
  139. package/dist-esm/source/make_private_key_from_pem.js +0 -4
  140. package/dist-esm/source/make_private_key_from_pem.js.map +0 -1
  141. package/dist-esm/source/oid_map.js +0 -297
  142. package/dist-esm/source/oid_map.js.map +0 -1
  143. package/dist-esm/source/public_private_match.js +0 -27
  144. package/dist-esm/source/public_private_match.js.map +0 -1
  145. package/dist-esm/source/subject.js +0 -89
  146. package/dist-esm/source/subject.js.map +0 -1
  147. package/dist-esm/source/verify_certificate_signature.js +0 -110
  148. package/dist-esm/source/verify_certificate_signature.js.map +0 -1
  149. package/dist-esm/source/x509/_build_public_key.js +0 -65
  150. package/dist-esm/source/x509/_build_public_key.js.map +0 -1
  151. package/dist-esm/source/x509/_crypto.js +0 -25
  152. package/dist-esm/source/x509/_crypto.js.map +0 -1
  153. package/dist-esm/source/x509/_get_attributes.js +0 -35
  154. package/dist-esm/source/x509/_get_attributes.js.map +0 -1
  155. package/dist-esm/source/x509/coerce_private_key.js +0 -85
  156. package/dist-esm/source/x509/coerce_private_key.js.map +0 -1
  157. package/dist-esm/source/x509/create_certificate_signing_request.js +0 -88
  158. package/dist-esm/source/x509/create_certificate_signing_request.js.map +0 -1
  159. package/dist-esm/source/x509/create_key_pair.js +0 -115
  160. package/dist-esm/source/x509/create_key_pair.js.map +0 -1
  161. package/dist-esm/source/x509/create_self_signed_certificate.js +0 -99
  162. package/dist-esm/source/x509/create_self_signed_certificate.js.map +0 -1
  163. package/dist-esm/source_nodejs/generate_private_key_filename.js +0 -80
  164. package/dist-esm/source_nodejs/generate_private_key_filename.js.map +0 -1
  165. package/dist-esm/source_nodejs/index.js +0 -5
  166. package/dist-esm/source_nodejs/index.js.map +0 -1
  167. package/dist-esm/source_nodejs/read.js +0 -99
  168. package/dist-esm/source_nodejs/read.js.map +0 -1
  169. package/dist-esm/source_nodejs/read_certificate_revocation_list.js +0 -57
  170. package/dist-esm/source_nodejs/read_certificate_revocation_list.js.map +0 -1
  171. package/dist-esm/source_nodejs/read_certificate_signing_request.js +0 -57
  172. package/dist-esm/source_nodejs/read_certificate_signing_request.js.map +0 -1
  173. package/index.d.ts +0 -2
  174. package/index.js +0 -4
  175. package/index_web.d.ts +0 -1
  176. package/index_web.js +0 -3
@@ -1,5 +0,0 @@
1
- export * from "./read.js";
2
- export * from "./read_certificate_revocation_list.js";
3
- export * from "./read_certificate_signing_request.js";
4
- export * from "./generate_private_key_filename.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source_nodejs/index.ts"],"names":[],"mappings":"AAuBA,cAAc,WAAW,CAAC;AAC1B,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC"}
@@ -1,99 +0,0 @@
1
- import assert from "assert";
2
- import fs from "fs";
3
- import path from "path";
4
- import { createPrivateKey, createPublicKey } from "crypto";
5
- import { convertPEMtoDER, identifyPemType, removeTrailingLF, toPem } from "../source/crypto_utils.js";
6
- var sshpk = require("sshpk");
7
- function _readPemFile(filename) {
8
- assert(typeof filename === "string");
9
- return removeTrailingLF(fs.readFileSync(filename, "utf-8"));
10
- }
11
- function _readPemOrDerFileAsDER(filename) {
12
- if (filename.match(/.*\.der/)) {
13
- return fs.readFileSync(filename);
14
- }
15
- var raw_key = _readPemFile(filename);
16
- return convertPEMtoDER(raw_key);
17
- }
18
- export function readCertificate(filename) {
19
- return _readPemOrDerFileAsDER(filename);
20
- }
21
- export function readPublicKey(filename) {
22
- if (filename.match(/.*\.der/)) {
23
- var der = fs.readFileSync(filename);
24
- return createPublicKey(der);
25
- }
26
- else {
27
- var raw_key = _readPemFile(filename);
28
- return createPublicKey(raw_key);
29
- }
30
- }
31
- function myCreatePrivateKey(rawKey) {
32
- if (!createPrivateKey || process.env.NO_CREATE_PRIVATEKEY) {
33
- if (rawKey instanceof Buffer) {
34
- var pemKey = toPem(rawKey, "PRIVATE KEY");
35
- assert(["RSA PRIVATE KEY", "PRIVATE KEY"].indexOf(identifyPemType(pemKey)) >= 0);
36
- return { hidden: pemKey };
37
- }
38
- return { hidden: ensureTrailingLF(rawKey) };
39
- }
40
- var backup = process.env.OPENSSL_CONF;
41
- process.env.OPENSSL_CONF = "/dev/null";
42
- var retValue = createPrivateKey(rawKey);
43
- process.env.OPENSSL_CONF = backup;
44
- return { hidden: retValue };
45
- }
46
- export function makePrivateKeyThumbPrint(privateKey) {
47
- return Buffer.alloc(0);
48
- }
49
- function ensureTrailingLF(str) {
50
- return str.match(/\n$/) ? str : str + "\n";
51
- }
52
- export function readPrivateKey(filename) {
53
- if (filename.match(/.*\.der/)) {
54
- var der = fs.readFileSync(filename);
55
- return myCreatePrivateKey(der);
56
- }
57
- else {
58
- var raw_key = _readPemFile(filename);
59
- return myCreatePrivateKey(raw_key);
60
- }
61
- }
62
- export function readCertificatePEM(filename) {
63
- return _readPemFile(filename);
64
- }
65
- export function readPublicKeyPEM(filename) {
66
- return _readPemFile(filename);
67
- }
68
- export function readPrivateKeyPEM(filename) {
69
- return _readPemFile(filename);
70
- }
71
- var __certificate_store = path.join(__dirname, "../../certificates/");
72
- export function setCertificateStore(store) {
73
- var old_store = __certificate_store;
74
- __certificate_store = store;
75
- return old_store;
76
- }
77
- export function readPrivateRsaKey(filename) {
78
- if (!createPrivateKey) {
79
- throw new Error("createPrivateKey is not supported in this environment");
80
- }
81
- if (filename.substring(0, 1) !== "." && !fs.existsSync(filename)) {
82
- filename = __certificate_store + filename;
83
- }
84
- var content = fs.readFileSync(filename, "utf8");
85
- var sshKey = sshpk.parsePrivateKey(content, "auto");
86
- var key = sshKey.toString("pkcs1");
87
- var hidden = createPrivateKey({ format: "pem", type: "pkcs1", key: key });
88
- return { hidden: hidden };
89
- }
90
- export function readPublicRsaKey(filename) {
91
- if (filename.substring(0, 1) !== "." && !fs.existsSync(filename)) {
92
- filename = __certificate_store + filename;
93
- }
94
- var content = fs.readFileSync(filename, "utf-8");
95
- var sshKey = sshpk.parseKey(content, "ssh");
96
- var key = sshKey.toString("pkcs1");
97
- return createPublicKey({ format: "pem", type: "pkcs1", key: key });
98
- }
99
- //# sourceMappingURL=read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,CAAC;IAC5C,IAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;IACvE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC7C,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC9D,QAAQ,GAAG,mBAAmB,GAAG,QAAQ,CAAC;KAC7C;IACD,IAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,IAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,IAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAQ,CAAC;IAC5C,OAAO,eAAe,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAA,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -1,57 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import fs from "fs";
38
- import { promisify } from "util";
39
- import { convertPEMtoDER } from "../source/crypto_utils.js";
40
- export function readCertificateRevocationList(filename) {
41
- return __awaiter(this, void 0, void 0, function () {
42
- var crl, raw_crl;
43
- return __generator(this, function (_a) {
44
- switch (_a.label) {
45
- case 0: return [4, promisify(fs.readFile)(filename)];
46
- case 1:
47
- crl = _a.sent();
48
- if (crl[0] === 0x30 && crl[1] === 0x82) {
49
- return [2, crl];
50
- }
51
- raw_crl = crl.toString();
52
- return [2, convertPEMtoDER(raw_crl)];
53
- }
54
- });
55
- });
56
- }
57
- //# sourceMappingURL=read_certificate_revocation_list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read_certificate_revocation_list.js","sourceRoot":"","sources":["../../source_nodejs/read_certificate_revocation_list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,MAAM,UAAgB,6BAA6B,CAAC,QAAgB;;;;;wBACpD,WAAM,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAA;;oBAA5C,GAAG,GAAG,SAAsC;oBAClD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;wBAEpC,WAAO,GAAgC,EAAC;qBAC3C;oBACK,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;oBAC/B,WAAO,eAAe,CAAC,OAAO,CAAC,EAAC;;;;CACnC"}
@@ -1,57 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
- function verb(n) { return function (v) { return step([n, v]); }; }
14
- function step(op) {
15
- if (f) throw new TypeError("Generator is already executing.");
16
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
- if (y = 0, t) op = [op[0] & 2, t.value];
19
- switch (op[0]) {
20
- case 0: case 1: t = op; break;
21
- case 4: _.label++; return { value: op[1], done: false };
22
- case 5: _.label++; y = op[1]; op = [0]; continue;
23
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
- default:
25
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
- if (t[2]) _.ops.pop();
30
- _.trys.pop(); continue;
31
- }
32
- op = body.call(thisArg, _);
33
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
- }
36
- };
37
- import fs from "fs";
38
- import { promisify } from "util";
39
- import { convertPEMtoDER } from "../source/crypto_utils.js";
40
- export function readCertificateSigningRequest(filename) {
41
- return __awaiter(this, void 0, void 0, function () {
42
- var csr, raw_crl;
43
- return __generator(this, function (_a) {
44
- switch (_a.label) {
45
- case 0: return [4, promisify(fs.readFile)(filename)];
46
- case 1:
47
- csr = _a.sent();
48
- if (csr[0] === 0x30 && csr[1] === 0x82) {
49
- return [2, csr];
50
- }
51
- raw_crl = csr.toString();
52
- return [2, convertPEMtoDER(raw_crl)];
53
- }
54
- });
55
- });
56
- }
57
- //# sourceMappingURL=read_certificate_signing_request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read_certificate_signing_request.js","sourceRoot":"","sources":["../../source_nodejs/read_certificate_signing_request.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAK5D,MAAM,UAAgB,6BAA6B,CAAC,QAAgB;;;;;wBACpD,WAAM,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAA;;oBAA5C,GAAG,GAAG,SAAsC;oBAClD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;wBAEpC,WAAO,GAAgC,EAAC;qBAC3C;oBACK,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;oBAC/B,WAAO,eAAe,CAAC,OAAO,CAAC,EAAC;;;;CACnC"}
package/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./dist-types/source/index.d.js";
2
- export * from "./dist-types/source_nodejs/index.d.js";
package/index.js DELETED
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- ...require("./dist-cjs/source"),
3
- ...require("./dist-cjs/source_nodejs"),
4
- };
package/index_web.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./dist-types/source/index.d.js";
package/index_web.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- ...require("./dist-cjs/source"),
3
- };