node-opcua-crypto 1.8.0 → 1.9.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 (115) hide show
  1. package/.fossa.yml +18 -18
  2. package/.github/FUNDING.yml +12 -12
  3. package/.github/workflows/main.yml +32 -0
  4. package/.prettierrc.js +6 -6
  5. package/LICENSE +22 -22
  6. package/README.md +14 -14
  7. package/dist/asn1.d.ts +69 -0
  8. package/dist/asn1.js +349 -0
  9. package/dist/asn1.js.map +1 -0
  10. package/dist/buffer_utils.d.ts +6 -0
  11. package/dist/buffer_utils.js +22 -0
  12. package/dist/buffer_utils.js.map +1 -0
  13. package/dist/common.d.ts +11 -0
  14. package/dist/common.js +3 -0
  15. package/dist/common.js.map +1 -0
  16. package/dist/crypto_explore_certificate.d.ts +95 -0
  17. package/dist/crypto_explore_certificate.js +547 -0
  18. package/dist/crypto_explore_certificate.js.map +1 -0
  19. package/dist/crypto_utils.d.ts +106 -0
  20. package/dist/crypto_utils.js +370 -0
  21. package/dist/crypto_utils.js.map +1 -0
  22. package/dist/derived_keys.d.ts +72 -0
  23. package/dist/derived_keys.js +247 -0
  24. package/dist/derived_keys.js.map +1 -0
  25. package/dist/explore_certificate.d.ts +30 -0
  26. package/dist/explore_certificate.js +44 -0
  27. package/dist/explore_certificate.js.map +1 -0
  28. package/dist/explore_certificate_revocation_list.d.ts +30 -0
  29. package/dist/explore_certificate_revocation_list.js +67 -0
  30. package/dist/explore_certificate_revocation_list.js.map +1 -0
  31. package/dist/index.d.ts +10 -0
  32. package/dist/index.js +23 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/oid_map.d.ts +7 -0
  35. package/dist/oid_map.js +262 -0
  36. package/dist/oid_map.js.map +1 -0
  37. package/dist/source/asn1.d.ts +73 -72
  38. package/dist/source/asn1.js +359 -350
  39. package/dist/source/asn1.js.map +1 -1
  40. package/dist/source/buffer_utils.d.ts +6 -6
  41. package/dist/source/buffer_utils.js +21 -21
  42. package/dist/source/common.d.ts +12 -12
  43. package/dist/source/common.js +2 -2
  44. package/dist/source/crypto_explore_certificate.d.ts +107 -107
  45. package/dist/source/crypto_explore_certificate.js +600 -571
  46. package/dist/source/crypto_explore_certificate.js.map +1 -1
  47. package/dist/source/crypto_utils.d.ts +78 -78
  48. package/dist/source/crypto_utils.js +280 -280
  49. package/dist/source/crypto_utils.js.map +1 -1
  50. package/dist/source/derived_keys.d.ts +72 -72
  51. package/dist/source/derived_keys.js +248 -245
  52. package/dist/source/derived_keys.js.map +1 -1
  53. package/dist/source/explore_certificate.d.ts +30 -30
  54. package/dist/source/explore_certificate.js +43 -43
  55. package/dist/source/explore_certificate.js.map +1 -1
  56. package/dist/source/explore_certificate_revocation_list.d.ts +28 -28
  57. package/dist/source/explore_certificate_revocation_list.js +44 -44
  58. package/dist/source/explore_certificate_revocation_list.js.map +1 -1
  59. package/dist/source/explore_certificate_signing_request.d.ts +13 -13
  60. package/dist/source/explore_certificate_signing_request.js +44 -44
  61. package/dist/source/explore_certificate_signing_request.js.map +1 -1
  62. package/dist/source/explore_private_key.d.ts +29 -29
  63. package/dist/source/explore_private_key.js +96 -96
  64. package/dist/source/explore_private_key.js.map +1 -1
  65. package/dist/source/index.d.ts +13 -13
  66. package/dist/source/index.js +25 -25
  67. package/dist/source/oid_map.d.ts +7 -7
  68. package/dist/source/oid_map.js +303 -261
  69. package/dist/source/oid_map.js.map +1 -1
  70. package/dist/source/public_private_match.d.ts +3 -3
  71. package/dist/source/public_private_match.js +16 -16
  72. package/dist/source/public_private_match.js.map +1 -1
  73. package/dist/source/verify_certificate_signature.d.ts +10 -10
  74. package/dist/source/verify_certificate_signature.js +101 -101
  75. package/dist/source/verify_certificate_signature.js.map +1 -1
  76. package/dist/source_nodejs/index.d.ts +3 -3
  77. package/dist/source_nodejs/index.js +15 -15
  78. package/dist/source_nodejs/read.d.ts +29 -29
  79. package/dist/source_nodejs/read.js +94 -94
  80. package/dist/source_nodejs/read.js.map +1 -1
  81. package/dist/source_nodejs/read_certificate_revocation_list.d.ts +2 -2
  82. package/dist/source_nodejs/read_certificate_revocation_list.js +27 -27
  83. package/dist/source_nodejs/read_certificate_revocation_list.js.map +1 -1
  84. package/dist/source_nodejs/read_certificate_signing_request.d.ts +3 -3
  85. package/dist/source_nodejs/read_certificate_signing_request.js +27 -27
  86. package/dist/source_nodejs/read_certificate_signing_request.js.map +1 -1
  87. package/dist/verify_cerficate_signature.d.ts +10 -0
  88. package/dist/verify_cerficate_signature.js +102 -0
  89. package/dist/verify_cerficate_signature.js.map +1 -0
  90. package/index.d.ts +2 -2
  91. package/index.js +4 -4
  92. package/index_web.js +3 -3
  93. package/package.json +19 -22
  94. package/source/asn1.ts +404 -398
  95. package/source/buffer_utils.ts +18 -18
  96. package/source/common.ts +13 -13
  97. package/source/crypto_explore_certificate.ts +763 -728
  98. package/source/crypto_utils.ts +321 -321
  99. package/source/derived_keys.ts +287 -284
  100. package/source/explore_certificate.ts +66 -66
  101. package/source/explore_certificate_revocation_list.ts +93 -93
  102. package/source/explore_certificate_signing_request.ts +58 -58
  103. package/source/explore_private_key.ts +121 -121
  104. package/source/index.ts +13 -13
  105. package/source/oid_map.ts +310 -265
  106. package/source/public_private_match.ts +17 -17
  107. package/source/verify_certificate_signature.ts +105 -105
  108. package/source_nodejs/index.ts +2 -2
  109. package/source_nodejs/read.ts +95 -95
  110. package/source_nodejs/read_certificate_revocation_list.ts +14 -14
  111. package/source_nodejs/read_certificate_signing_request.ts +17 -17
  112. package/test_certificate.ts +34 -34
  113. package/tsconfig.json +18 -18
  114. package/tslint.json +34 -34
  115. package/pnpm-lock.yaml +0 -1767
@@ -1,95 +1,95 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readPublicRsaKey = exports.readPrivateRsaKey = exports.read_sshkey_as_pem = exports.setCertificateStore = exports.readPrivateKeyPEM = exports.readPublicKeyPEM = exports.readCertificatePEM = exports.readPrivateKey = exports.readPublicKey = exports.readCertificate = exports.readKeyPem = void 0;
4
- const assert = require("assert");
5
- const fs = require("fs");
6
- const path = require("path");
7
- const crypto_utils_1 = require("../source/crypto_utils");
8
- const sshpk = require("sshpk");
9
- /**
10
- * @method readKeyPem
11
- * @param filename
12
- */
13
- function readKeyPem(filename) {
14
- const raw_key = fs.readFileSync(filename, "utf8");
15
- const pemType = crypto_utils_1.identifyPemType(raw_key);
16
- assert(typeof pemType === "string"); // must have a valid pem type
17
- return raw_key;
18
- }
19
- exports.readKeyPem = readKeyPem;
20
- function _readPemFile(filename) {
21
- assert(typeof filename === "string");
22
- return fs.readFileSync(filename, "ascii");
23
- }
24
- function _readPemOrDerFileAsDER(filename) {
25
- if (filename.match(/.*\.der/)) {
26
- return fs.readFileSync(filename);
27
- }
28
- const raw_key = _readPemFile(filename);
29
- return crypto_utils_1.convertPEMtoDER(raw_key);
30
- }
31
- /**
32
- * read a DER or PEM certificate from file
33
- */
34
- function readCertificate(filename) {
35
- return _readPemOrDerFileAsDER(filename);
36
- }
37
- exports.readCertificate = readCertificate;
38
- /**
39
- * read a DER or PEM certificate from file
40
- */
41
- function readPublicKey(filename) {
42
- return _readPemOrDerFileAsDER(filename);
43
- }
44
- exports.readPublicKey = readPublicKey;
45
- /**
46
- * read a DER or PEM certificate from file
47
- */
48
- function readPrivateKey(filename) {
49
- return _readPemOrDerFileAsDER(filename);
50
- }
51
- exports.readPrivateKey = readPrivateKey;
52
- function readCertificatePEM(filename) {
53
- return _readPemFile(filename);
54
- }
55
- exports.readCertificatePEM = readCertificatePEM;
56
- function readPublicKeyPEM(filename) {
57
- return _readPemFile(filename);
58
- }
59
- exports.readPublicKeyPEM = readPublicKeyPEM;
60
- function readPrivateKeyPEM(filename) {
61
- return _readPemFile(filename);
62
- }
63
- exports.readPrivateKeyPEM = readPrivateKeyPEM;
64
- let __certificate_store = path.join(__dirname, "../../certificates/");
65
- function setCertificateStore(store) {
66
- const old_store = __certificate_store;
67
- __certificate_store = store;
68
- return old_store;
69
- }
70
- exports.setCertificateStore = setCertificateStore;
71
- function read_sshkey_as_pem(filename) {
72
- if (filename.substr(0, 1) !== ".") {
73
- filename = __certificate_store + filename;
74
- }
75
- const key = fs.readFileSync(filename, "ascii");
76
- const sshKey = sshpk.parseKey(key, "ssh");
77
- return sshKey.toString("pkcs8");
78
- }
79
- exports.read_sshkey_as_pem = read_sshkey_as_pem;
80
- /**
81
- *
82
- * @param filename
83
- */
84
- function readPrivateRsaKey(filename) {
85
- if (filename.substr(0, 1) !== "." && !fs.existsSync(filename)) {
86
- filename = __certificate_store + filename;
87
- }
88
- return fs.readFileSync(filename, "ascii");
89
- }
90
- exports.readPrivateRsaKey = readPrivateRsaKey;
91
- function readPublicRsaKey(filename) {
92
- return readPrivateRsaKey(filename);
93
- }
94
- exports.readPublicRsaKey = readPublicRsaKey;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readPublicRsaKey = exports.readPrivateRsaKey = exports.read_sshkey_as_pem = exports.setCertificateStore = exports.readPrivateKeyPEM = exports.readPublicKeyPEM = exports.readCertificatePEM = exports.readPrivateKey = exports.readPublicKey = exports.readCertificate = exports.readKeyPem = void 0;
4
+ const assert = require("assert");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+ const crypto_utils_1 = require("../source/crypto_utils");
8
+ const sshpk = require("sshpk");
9
+ /**
10
+ * @method readKeyPem
11
+ * @param filename
12
+ */
13
+ function readKeyPem(filename) {
14
+ const raw_key = fs.readFileSync(filename, "utf8");
15
+ const pemType = (0, crypto_utils_1.identifyPemType)(raw_key);
16
+ assert(typeof pemType === "string"); // must have a valid pem type
17
+ return raw_key;
18
+ }
19
+ exports.readKeyPem = readKeyPem;
20
+ function _readPemFile(filename) {
21
+ assert(typeof filename === "string");
22
+ return fs.readFileSync(filename, "ascii");
23
+ }
24
+ function _readPemOrDerFileAsDER(filename) {
25
+ if (filename.match(/.*\.der/)) {
26
+ return fs.readFileSync(filename);
27
+ }
28
+ const raw_key = _readPemFile(filename);
29
+ return (0, crypto_utils_1.convertPEMtoDER)(raw_key);
30
+ }
31
+ /**
32
+ * read a DER or PEM certificate from file
33
+ */
34
+ function readCertificate(filename) {
35
+ return _readPemOrDerFileAsDER(filename);
36
+ }
37
+ exports.readCertificate = readCertificate;
38
+ /**
39
+ * read a DER or PEM certificate from file
40
+ */
41
+ function readPublicKey(filename) {
42
+ return _readPemOrDerFileAsDER(filename);
43
+ }
44
+ exports.readPublicKey = readPublicKey;
45
+ /**
46
+ * read a DER or PEM certificate from file
47
+ */
48
+ function readPrivateKey(filename) {
49
+ return _readPemOrDerFileAsDER(filename);
50
+ }
51
+ exports.readPrivateKey = readPrivateKey;
52
+ function readCertificatePEM(filename) {
53
+ return _readPemFile(filename);
54
+ }
55
+ exports.readCertificatePEM = readCertificatePEM;
56
+ function readPublicKeyPEM(filename) {
57
+ return _readPemFile(filename);
58
+ }
59
+ exports.readPublicKeyPEM = readPublicKeyPEM;
60
+ function readPrivateKeyPEM(filename) {
61
+ return _readPemFile(filename);
62
+ }
63
+ exports.readPrivateKeyPEM = readPrivateKeyPEM;
64
+ let __certificate_store = path.join(__dirname, "../../certificates/");
65
+ function setCertificateStore(store) {
66
+ const old_store = __certificate_store;
67
+ __certificate_store = store;
68
+ return old_store;
69
+ }
70
+ exports.setCertificateStore = setCertificateStore;
71
+ function read_sshkey_as_pem(filename) {
72
+ if (filename.substr(0, 1) !== ".") {
73
+ filename = __certificate_store + filename;
74
+ }
75
+ const key = fs.readFileSync(filename, "ascii");
76
+ const sshKey = sshpk.parseKey(key, "ssh");
77
+ return sshKey.toString("pkcs8");
78
+ }
79
+ exports.read_sshkey_as_pem = read_sshkey_as_pem;
80
+ /**
81
+ *
82
+ * @param filename
83
+ */
84
+ function readPrivateRsaKey(filename) {
85
+ if (filename.substr(0, 1) !== "." && !fs.existsSync(filename)) {
86
+ filename = __certificate_store + filename;
87
+ }
88
+ return fs.readFileSync(filename, "ascii");
89
+ }
90
+ exports.readPrivateRsaKey = readPrivateRsaKey;
91
+ function readPublicRsaKey(filename) {
92
+ return readPrivateRsaKey(filename);
93
+ }
94
+ exports.readPublicRsaKey = readPublicRsaKey;
95
95
  //# sourceMappingURL=read.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.js","sourceRoot":"","sources":["../../source_nodejs/read.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,yBAAyB;AACzB,6BAA6B;AAE7B,yDAA0E;AAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B;;;GAGG;AACH,SAAgB,UAAU,CAAC,QAAgB;IACvC,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,8BAAe,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,6BAA6B;IAClE,OAAO,OAAO,CAAC;AACnB,CAAC;AALD,gCAKC;AAED,SAAS,YAAY,CAAC,QAAgB;IAClC,MAAM,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC;IACrC,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,sBAAsB,CAAC,QAAgB;IAC5C,IAAI,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QAC3B,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAW,CAAC;KAC9C;IACD,MAAM,OAAO,GAAW,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,8BAAe,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,QAAgB;IAC5C,OAAO,sBAAsB,CAAC,QAAQ,CAAgB,CAAC;AAC3D,CAAC;AAFD,0CAEC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,QAAgB;IAC1C,OAAO,sBAA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E,KAAK,CAAC,CAAC;IAE1C,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAQ,CAAC;AAC3C,CAAC;AARD,gDAQC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,QAAgB;IAC9C,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;QAC3D,QAAQ,GAAG,mBAAmB,GAAG,QAAQ,CAAC;KAC7C;IACD,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAW,CAAC;AACxD,CAAC;AALD,8CAKC;AAED,SAAgB,gBAAgB,CAAC,QAAgB;IAC7C,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC;AAFD,4CAEC"}
@@ -1,2 +1,2 @@
1
- import { CertificateRevocationList } from "../source/common";
2
- export declare function readCertificateRevocationList(filename: string): Promise<CertificateRevocationList>;
1
+ import { CertificateRevocationList } from "../source/common";
2
+ export declare function readCertificateRevocationList(filename: string): Promise<CertificateRevocationList>;
@@ -1,28 +1,28 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.readCertificateRevocationList = void 0;
13
- const fs = require("fs");
14
- const util_1 = require("util");
15
- const crypto_utils_1 = require("../source/crypto_utils");
16
- function readCertificateRevocationList(filename) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const crl = yield util_1.promisify(fs.readFile)(filename);
19
- if (crl[0] === 0x30 && crl[1] === 0x82) {
20
- // der format
21
- return crl;
22
- }
23
- const raw_crl = crl.toString();
24
- return crypto_utils_1.convertPEMtoDER(raw_crl);
25
- });
26
- }
27
- exports.readCertificateRevocationList = readCertificateRevocationList;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.readCertificateRevocationList = void 0;
13
+ const fs = require("fs");
14
+ const util_1 = require("util");
15
+ const crypto_utils_1 = require("../source/crypto_utils");
16
+ function readCertificateRevocationList(filename) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const crl = yield (0, util_1.promisify)(fs.readFile)(filename);
19
+ if (crl[0] === 0x30 && crl[1] === 0x82) {
20
+ // der format
21
+ return crl;
22
+ }
23
+ const raw_crl = crl.toString();
24
+ return (0, crypto_utils_1.convertPEMtoDER)(raw_crl);
25
+ });
26
+ }
27
+ exports.readCertificateRevocationList = readCertificateRevocationList;
28
28
  //# sourceMappingURL=read_certificate_revocation_list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read_certificate_revocation_list.js","sourceRoot":"","sources":["../../source_nodejs/read_certificate_revocation_list.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAAyB;AACzB,+BAAiC;AACjC,yDAAyD;AAGzD,SAAsB,6BAA6B,CAAC,QAAgB;;QAChE,MAAM,GAAG,GAAG,MAAM,gBAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpC,aAAa;YACb,OAAO,GAAgC,CAAC;SAC3C;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC/B,OAAO,8BAAe,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CAAA;AARD,sEAQC"}
1
+ {"version":3,"file":"read_certificate_revocation_list.js","sourceRoot":"","sources":["../../source_nodejs/read_certificate_revocation_list.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAAyB;AACzB,+BAAiC;AACjC,yDAAyD;AAGzD,SAAsB,6BAA6B,CAAC,QAAgB;;QAChE,MAAM,GAAG,GAAG,MAAM,IAAA,gBAAS,EAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpC,aAAa;YACb,OAAO,GAAgC,CAAC;SAC3C;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC/B,OAAO,IAAA,8BAAe,EAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CAAA;AARD,sEAQC"}
@@ -1,3 +1,3 @@
1
- /// <reference types="node" />
2
- export declare type CertificateSigningRequest = Buffer;
3
- export declare function readCertificateSigningRequest(filename: string): Promise<CertificateSigningRequest>;
1
+ /// <reference types="node" />
2
+ export declare type CertificateSigningRequest = Buffer;
3
+ export declare function readCertificateSigningRequest(filename: string): Promise<CertificateSigningRequest>;
@@ -1,28 +1,28 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.readCertificateSigningRequest = void 0;
13
- const fs = require("fs");
14
- const util_1 = require("util");
15
- const crypto_utils_1 = require("../source/crypto_utils");
16
- function readCertificateSigningRequest(filename) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const csr = yield util_1.promisify(fs.readFile)(filename);
19
- if (csr[0] === 0x30 && csr[1] === 0x82) {
20
- // der format
21
- return csr;
22
- }
23
- const raw_crl = csr.toString();
24
- return crypto_utils_1.convertPEMtoDER(raw_crl);
25
- });
26
- }
27
- exports.readCertificateSigningRequest = readCertificateSigningRequest;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.readCertificateSigningRequest = void 0;
13
+ const fs = require("fs");
14
+ const util_1 = require("util");
15
+ const crypto_utils_1 = require("../source/crypto_utils");
16
+ function readCertificateSigningRequest(filename) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const csr = yield (0, util_1.promisify)(fs.readFile)(filename);
19
+ if (csr[0] === 0x30 && csr[1] === 0x82) {
20
+ // der format
21
+ return csr;
22
+ }
23
+ const raw_crl = csr.toString();
24
+ return (0, crypto_utils_1.convertPEMtoDER)(raw_crl);
25
+ });
26
+ }
27
+ exports.readCertificateSigningRequest = readCertificateSigningRequest;
28
28
  //# sourceMappingURL=read_certificate_signing_request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read_certificate_signing_request.js","sourceRoot":"","sources":["../../source_nodejs/read_certificate_signing_request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAAyB;AACzB,+BAAiC;AACjC,yDAAyD;AAMzD,SAAsB,6BAA6B,CAAC,QAAgB;;QAChE,MAAM,GAAG,GAAG,MAAM,gBAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpC,aAAa;YACb,OAAO,GAAgC,CAAC;SAC3C;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC/B,OAAO,8BAAe,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CAAA;AARD,sEAQC"}
1
+ {"version":3,"file":"read_certificate_signing_request.js","sourceRoot":"","sources":["../../source_nodejs/read_certificate_signing_request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yBAAyB;AACzB,+BAAiC;AACjC,yDAAyD;AAMzD,SAAsB,6BAA6B,CAAC,QAAgB;;QAChE,MAAM,GAAG,GAAG,MAAM,IAAA,gBAAS,EAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QACnD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;YACpC,aAAa;YACb,OAAO,GAAgC,CAAC;SAC3C;QACD,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC/B,OAAO,IAAA,8BAAe,EAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CAAA;AARD,sEAQC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="node" />
2
+ import { Certificate } from "./common";
3
+ export declare function verifyCertificateOrClrSignature(certificateOrCrl: Buffer, parentCerticate: Certificate): boolean;
4
+ export declare function verifyCertificateSignature(certificate: Certificate, parentCerticate: Certificate): boolean;
5
+ export declare function verifyCertificateRevocationListSignature(certificateRevocationList: Certificate, parentCerticate: Certificate): boolean;
6
+ export declare type _VerifyStatus = "BadCertificateIssuerUseNotAllowed" | "BadCertificateInvalid" | "Good";
7
+ export declare function verifyCertificateChain(certificateChain: Certificate[]): Promise<{
8
+ status: _VerifyStatus;
9
+ reason: string;
10
+ }>;
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ // tslint:disable: no-console
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.verifyCertificateChain = exports.verifyCertificateRevocationListSignature = exports.verifyCertificateSignature = exports.verifyCertificateOrClrSignature = void 0;
14
+ // Now that we got a hash of the orginal certificate,
15
+ // we need to verify if we can obtain the same hash by using the same hashing function
16
+ // (in this case SHA-384). In order to do that, we need to extract just the body of
17
+ // the signed certificate. Which, in our case, is everything but the signature.
18
+ // The start of the body is always the first digit of the second line of the following command:
19
+ const crypto = require("crypto");
20
+ const crypto_explore_certificate_1 = require("./crypto_explore_certificate");
21
+ const crypto_utils_1 = require("./crypto_utils");
22
+ const asn1_1 = require("./asn1");
23
+ function verifyCertificateOrClrSignature(certificateOrCrl, parentCerticate) {
24
+ const block_info = asn1_1.readTag(certificateOrCrl, 0);
25
+ const blocks = asn1_1._readStruct(certificateOrCrl, block_info);
26
+ const bufferToBeSigned = certificateOrCrl.slice(block_info.position, blocks[1].position - 2);
27
+ //xx console.log("bufferToBeSigned = ", bufferToBeSigned.length, bufferToBeSigned.toString("hex").substr(0, 50), bufferToBeSigned.toString("hex").substr(-10));
28
+ const signatureAlgorithm = asn1_1._readAlgorithmIdentifier(certificateOrCrl, blocks[1]);
29
+ const signatureValue = asn1_1._readSignatureValueBin(certificateOrCrl, blocks[2]);
30
+ const p = crypto_explore_certificate_1.split_der(parentCerticate)[0];
31
+ //xx const publicKey = extractPublicKeyFromCertificateSync(p);
32
+ const certPem = crypto_utils_1.toPem(p, "CERTIFICATE");
33
+ const verify = crypto.createVerify(signatureAlgorithm.identifier);
34
+ verify.update(bufferToBeSigned);
35
+ verify.end();
36
+ return verify.verify(certPem, signatureValue);
37
+ }
38
+ exports.verifyCertificateOrClrSignature = verifyCertificateOrClrSignature;
39
+ function verifyCertificateSignature(certificate, parentCerticate) {
40
+ return verifyCertificateOrClrSignature(certificate, parentCerticate);
41
+ }
42
+ exports.verifyCertificateSignature = verifyCertificateSignature;
43
+ function verifyCertificateRevocationListSignature(certificateRevocationList, parentCerticate) {
44
+ return verifyCertificateOrClrSignature(certificateRevocationList, parentCerticate);
45
+ }
46
+ exports.verifyCertificateRevocationListSignature = verifyCertificateRevocationListSignature;
47
+ function verifyCertificateChain(certificateChain) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ // verify that all the certificate
50
+ // second certificate must be used for CertificateSign
51
+ for (let index = 1; index < certificateChain.length; index++) {
52
+ const cert = certificateChain[index - 1];
53
+ const certParent = certificateChain[index];
54
+ // parent child must have keyCertSign
55
+ const certParentInfo = crypto_explore_certificate_1.exploreCertificate(certParent);
56
+ const keyUsage = certParentInfo.tbsCertificate.extensions.keyUsage;
57
+ // istanbul ignore next
58
+ if (!keyUsage.keyCertSign) {
59
+ return {
60
+ status: "BadCertificateIssuerUseNotAllowed",
61
+ reason: "One of the certificate in the chain has not keyUsage set for Certificate Signing",
62
+ };
63
+ }
64
+ const parentSignChild = verifyCertificateSignature(cert, certParent);
65
+ if (!parentSignChild) {
66
+ return {
67
+ status: "BadCertificateInvalid",
68
+ reason: "One of the certificate in the chain is not signing the previous certificate",
69
+ };
70
+ }
71
+ const certInfo = crypto_explore_certificate_1.exploreCertificate(cert);
72
+ // istanbul ignore next
73
+ if (!certInfo.tbsCertificate.extensions) {
74
+ return {
75
+ status: "BadCertificateInvalid",
76
+ reason: "Cannot finx X409 Extension 3 in certificate",
77
+ };
78
+ }
79
+ // istanbul ignore next
80
+ if (!certParentInfo.tbsCertificate.extensions || !certInfo.tbsCertificate.extensions.authorityKeyIdentifier) {
81
+ return {
82
+ status: "BadCertificateInvalid",
83
+ reason: "Cannot finx X409 Extension 3 in certificate (parent)",
84
+ };
85
+ }
86
+ // istanbul ignore next
87
+ if (certParentInfo.tbsCertificate.extensions.subjectKeyIdentifier !==
88
+ certInfo.tbsCertificate.extensions.authorityKeyIdentifier.keyIdentifier) {
89
+ return {
90
+ status: "BadCertificateInvalid",
91
+ reason: "subjectKeyIdentifier authorityKeyIdentifier in child certificate do not match subjectKeyIdentifier of parent certificate",
92
+ };
93
+ }
94
+ }
95
+ return {
96
+ status: "Good",
97
+ reason: `certificate chain is valid(length = ${certificateChain.length})`,
98
+ };
99
+ });
100
+ }
101
+ exports.verifyCertificateChain = verifyCertificateChain;
102
+ //# sourceMappingURL=verify_cerficate_signature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify_cerficate_signature.js","sourceRoot":"","sources":["../lib/verify_cerficate_signature.ts"],"names":[],"mappings":";AAAA,6BAA6B;;;;;;;;;;;;AAE7B,qDAAqD;AACrD,sFAAsF;AACtF,mFAAmF;AACnF,+EA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,CAAC;aACL;YAED,uBAAuB;YACvB,IACI,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,oBAAoB;gBAC7D,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,sBAAsB,CAAC,aAAa,EACzE;gBACE,OAAO;oBACH,MAAM,EAAE,uBAAuB;oBAC/B,MAAM,EACF,0HAA0H;iBACjI,CAAC;aACL;SACJ;QACD,OAAO;YACH,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,uCAAuC,gBAAgB,CAAC,MAAM,GAAG;SAC5E,CAAC;IACN,CAAC;CAAA;AA7DD,wDA6DC"}
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./dist/source";
2
- export * from "./dist/source_nodejs";
1
+ export * from "./dist/source";
2
+ export * from "./dist/source_nodejs";
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
2
- ...require("./dist/source"),
3
- ...require("./dist/source_nodejs"),
4
- };
1
+ module.exports = {
2
+ ...require("./dist/source"),
3
+ ...require("./dist/source_nodejs"),
4
+ };
package/index_web.js CHANGED
@@ -1,3 +1,3 @@
1
- module.exports = {
2
- ...require("./dist/source"),
3
- };
1
+ module.exports = {
2
+ ...require("./dist/source"),
3
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-crypto",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Crypto tools for Node-OPCUA",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "cost-of-modules": "npx cost-of-modules --no-install",
16
16
  "release-it": "npx release-it",
17
17
  "prettier-format": "prettier --config .prettierrc.js lib/**/*.ts test/**/*.ts --write",
18
- "ncu": "npx npm-check-updates -u"
18
+ "ncu": "npx npm-check-updates -u -x env-paths,chalk"
19
19
  },
20
20
  "keywords": [
21
21
  "OPCUA",
@@ -28,31 +28,28 @@
28
28
  "author": "Etienne Rossignon",
29
29
  "license": "MIT",
30
30
  "devDependencies": {
31
- "@types/mocha": "^8.2.2",
32
- "@types/node": "^15.6.1",
33
- "@types/should": "^13.0.0",
34
- "@typescript-eslint/eslint-plugin": "^4.25.0",
35
- "@typescript-eslint/parser": "^4.25.0",
36
- "eslint": "^7.27.0",
37
- "eslint-config-prettier": "^8.3.0",
38
- "eslint-plugin-prettier": "^3.4.0",
39
- "lorem-ipsum": "^2.0.3",
40
- "mocha": "^8.4.0",
41
- "prettier": "^2.3.0",
31
+ "@types/mocha": "^9.1.0",
32
+ "@types/node": "^17.0.21",
33
+ "@typescript-eslint/eslint-plugin": "^5.12.1",
34
+ "@typescript-eslint/parser": "^5.12.1",
35
+ "eslint": "^8.10.0",
36
+ "eslint-config-prettier": "^8.4.0",
37
+ "eslint-plugin-prettier": "^4.0.0",
38
+ "lorem-ipsum": "^2.0.4",
39
+ "mocha": "^9.2.1",
40
+ "prettier": "^2.5.1",
42
41
  "should": "^13.2.3",
43
42
  "source-map": "^0.7.3",
44
- "source-map-support": "^0.5.19",
45
- "ts-node": "^10.0.0",
46
- "tslint": "^6.1.3",
47
- "tslint-config-prettier": "^1.18.0",
48
- "typescript": "^4.3.2"
43
+ "source-map-support": "^0.5.21",
44
+ "ts-node": "^10.5.0",
45
+ "typescript": "^4.5.5"
49
46
  },
50
47
  "dependencies": {
51
48
  "better-assert": "^1.0.2",
52
- "chalk": "^4.1.1",
53
- "hexy": "^0.3.1",
54
- "jsrsasign": "^10.2.0",
55
- "sshpk": "^1.16.1"
49
+ "chalk": "^4.1.2",
50
+ "hexy": "0.3.4",
51
+ "jsrsasign": "^10.5.8",
52
+ "sshpk": "^1.17.0"
56
53
  },
57
54
  "repository": {
58
55
  "type": "git",