node-opcua-crypto 4.8.0 → 4.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +23 -23
- package/README.md +114 -114
- package/dist/{chunk-XIYZLEAS.mjs → chunk-VAMKYXNP.mjs} +5 -9
- package/dist/{chunk-AKMXF5ZH.mjs → chunk-WYY6WVVJ.mjs} +2 -2
- package/dist/index.js +3 -6
- package/dist/index.mjs +2 -2
- package/dist/index_web.js +3 -6
- package/dist/index_web.mjs +1 -1
- package/index.mjs +1 -1
- package/index_web.ts +1 -1
- package/package.json +6 -6
- package/dist/source/index.d.mts +0 -523
- package/dist/source/index.d.ts +0 -523
- package/dist/source/index.js +0 -6367
- package/dist/source/index.mjs +0 -192
- package/dist/source/index_web.d.mts +0 -4
- package/dist/source/index_web.d.ts +0 -4
- package/dist/source/index_web.js +0 -6367
- package/dist/source/index_web.mjs +0 -191
- package/dist/source_nodejs/index.d.mts +0 -46
- package/dist/source_nodejs/index.d.ts +0 -46
- package/dist/source_nodejs/index.js +0 -4171
- package/dist/source_nodejs/index.mjs +0 -37
package/LICENSE
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) Etienne Rossignon 2015-2022
|
|
4
|
-
Copyright (c) Sterfive.com 2022-2024
|
|
5
|
-
|
|
6
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
in the Software without restriction, including without limitation the rights
|
|
9
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
furnished to do so, subject to the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
SOFTWARE.
|
|
23
|
-
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Etienne Rossignon 2015-2022
|
|
4
|
+
Copyright (c) Sterfive.com 2022-2024
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
|
package/README.md
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
# node-opcua-crypto
|
|
2
|
-
|
|
3
|
-
NodeOPCUA Crypto is a powerful JavaScript module for handling security and cryptography for OPCUA. It's written in TypeScript and runs smoothly on Node.js and in the browser.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmtrends.com/node-opcua-crypto)
|
|
6
|
-
[](https://www.npmjs.com/package/node-opcua-crypto?activeTab=versions)
|
|
7
|
-
[](https://github.com/node-opcua/node-opcua-crypto/actions/workflows/main.yml)
|
|
8
|
-
[](https://codeclimate.com/github/node-opcua/node-opcua-crypto)
|
|
9
|
-
[](https://coveralls.io/github/node-opcua/node-opcua-crypto?branch=master)
|
|
10
|
-
[](https://packagephobia.com/result?p=node-opcua-crypto)
|
|
11
|
-
[](https://app.fossa.com/projects/custom%2B20248%2Fgithub.com%2Fnode-opcua%2Fnode-opcua-crypto?ref=badge_shield)
|
|
12
|
-
<!-- [](https://codeclimate.com/github/node-opcua/node-opcua-crypto/coverage) -->
|
|
13
|
-
|
|
14
|
-
## Features
|
|
15
|
-
|
|
16
|
-
* a comprehensive set of cryptographic functionalities.
|
|
17
|
-
* supports both Node.js and browser environments.
|
|
18
|
-
* compatible with TypeScript for robust, type-safe coding.
|
|
19
|
-
* implements advanced security standards for OPCUA.
|
|
20
|
-
|
|
21
|
-
## Getting Started
|
|
22
|
-
|
|
23
|
-
To use NodeOPCUA Crypto in your project, follow these steps:
|
|
24
|
-
|
|
25
|
-
#### Installation
|
|
26
|
-
|
|
27
|
-
``` bash
|
|
28
|
-
npm install nodeopcua-crypto
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Usage
|
|
32
|
-
|
|
33
|
-
``` bash
|
|
34
|
-
|
|
35
|
-
import { generatePrivateKey, privateKeyToPEM, CertificatePurpose, createSelfSignedCertificate } from "./node-opcua-crypto.js";
|
|
36
|
-
|
|
37
|
-
async function demonstratePrivateKeyAndSelfSignedCertificateCreation() {
|
|
38
|
-
|
|
39
|
-
// create the Private Key
|
|
40
|
-
const privateKey = await generatePrivateKey();
|
|
41
|
-
|
|
42
|
-
// convert the private key to a PEM format
|
|
43
|
-
const { privPem } = await privateKeyToPEM(privateKey);
|
|
44
|
-
|
|
45
|
-
console.log(privPem);
|
|
46
|
-
|
|
47
|
-
// create a self-sign certificate
|
|
48
|
-
const { cert } = await createSelfSignedCertificate({
|
|
49
|
-
privateKey,
|
|
50
|
-
notAfter: new Date(2025, 1, 1),
|
|
51
|
-
notBefore: new Date(2019, 1, 1),
|
|
52
|
-
subject: "CN=Test",
|
|
53
|
-
dns: ["DNS1", "DNS2"],
|
|
54
|
-
ip: ["192.168.1.1"],
|
|
55
|
-
applicationUri: "urn:HOSTNAME:ServerDescription",
|
|
56
|
-
purpose: CertificatePurpose.ForApplication,
|
|
57
|
-
});
|
|
58
|
-
console.log(cert);
|
|
59
|
-
}
|
|
60
|
-
demonstratePrivateKeyAndSelfSignedCertificateCreation();
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Please refer to the examples directory for more specific use cases and comprehensive samples.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## Support
|
|
69
|
-
|
|
70
|
-
For any inquiries or issues related to NodeOPCUA Crypto, you can contact us at contact@sterfive.com. Please note that priority support is available to NodeOPCUA Support Subscription members.
|
|
71
|
-
|
|
72
|
-
### Getting professional support
|
|
73
|
-
|
|
74
|
-
NodeOPCUA PKI is developed and maintained by sterfive.com.
|
|
75
|
-
|
|
76
|
-
To get professional support, consider subscribing to the node-opcua membership community:
|
|
77
|
-
|
|
78
|
-
[](https://support.sterfive.com)
|
|
79
|
-
|
|
80
|
-
or contact [sterfive](https://www.sterfive.com) for dedicated consulting and more advanced support.
|
|
81
|
-
|
|
82
|
-
## Contributing
|
|
83
|
-
|
|
84
|
-
We appreciate contributions from the community. To contribute:
|
|
85
|
-
|
|
86
|
-
* Fork the repository.
|
|
87
|
-
* Create a new branch.
|
|
88
|
-
* Commit your changes.
|
|
89
|
-
* Submit a pull request.
|
|
90
|
-
* Sign the CLA (Contributor Licence Agreement) form
|
|
91
|
-
|
|
92
|
-
For more detailed instructions, refer to the CONTRIBUTING.md file.
|
|
93
|
-
|
|
94
|
-
## License
|
|
95
|
-
|
|
96
|
-
NodeOPCUA Crypto is MIT licensed. See the LICENSE file for full license details.
|
|
97
|
-
|
|
98
|
-
Copyright © 2023-2024 Sterfive.com.
|
|
99
|
-
|
|
100
|
-
## Disclaimer
|
|
101
|
-
|
|
102
|
-
NodeOPCUA Crypto is provided as-is, and while we strive to ensure its quality and security, Sterfive.com cannot be held liable for any damage caused directly or indirectly by the usage of this module.
|
|
103
|
-
|
|
104
|
-
Please report any issues or vulnerabilities you find via the issue tracker.
|
|
105
|
-
|
|
106
|
-
Thank you for considering NodeOPCUA Crypto for your OPCUA cryptography needs. We look forward to seeing what you build with i
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
## Supporting the development effort - Sponsors & Backers
|
|
111
|
-
|
|
112
|
-
If you like `node-opcua-pki` and if you are relying on it in one of your projects, please consider becoming a backer and [sponsoring us](https://github.com/sponsors/node-opcua), this will help us to maintain a high-quality stack and constant evolution of this module.
|
|
113
|
-
|
|
114
|
-
If your company would like to participate and influence the development of future versions of `node-opcua` please contact [sterfive](mailto:contact@sterfive.com).
|
|
1
|
+
# node-opcua-crypto
|
|
2
|
+
|
|
3
|
+
NodeOPCUA Crypto is a powerful JavaScript module for handling security and cryptography for OPCUA. It's written in TypeScript and runs smoothly on Node.js and in the browser.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmtrends.com/node-opcua-crypto)
|
|
6
|
+
[](https://www.npmjs.com/package/node-opcua-crypto?activeTab=versions)
|
|
7
|
+
[](https://github.com/node-opcua/node-opcua-crypto/actions/workflows/main.yml)
|
|
8
|
+
[](https://codeclimate.com/github/node-opcua/node-opcua-crypto)
|
|
9
|
+
[](https://coveralls.io/github/node-opcua/node-opcua-crypto?branch=master)
|
|
10
|
+
[](https://packagephobia.com/result?p=node-opcua-crypto)
|
|
11
|
+
[](https://app.fossa.com/projects/custom%2B20248%2Fgithub.com%2Fnode-opcua%2Fnode-opcua-crypto?ref=badge_shield)
|
|
12
|
+
<!-- [](https://codeclimate.com/github/node-opcua/node-opcua-crypto/coverage) -->
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
* a comprehensive set of cryptographic functionalities.
|
|
17
|
+
* supports both Node.js and browser environments.
|
|
18
|
+
* compatible with TypeScript for robust, type-safe coding.
|
|
19
|
+
* implements advanced security standards for OPCUA.
|
|
20
|
+
|
|
21
|
+
## Getting Started
|
|
22
|
+
|
|
23
|
+
To use NodeOPCUA Crypto in your project, follow these steps:
|
|
24
|
+
|
|
25
|
+
#### Installation
|
|
26
|
+
|
|
27
|
+
``` bash
|
|
28
|
+
npm install nodeopcua-crypto
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Usage
|
|
32
|
+
|
|
33
|
+
``` bash
|
|
34
|
+
|
|
35
|
+
import { generatePrivateKey, privateKeyToPEM, CertificatePurpose, createSelfSignedCertificate } from "./node-opcua-crypto.js";
|
|
36
|
+
|
|
37
|
+
async function demonstratePrivateKeyAndSelfSignedCertificateCreation() {
|
|
38
|
+
|
|
39
|
+
// create the Private Key
|
|
40
|
+
const privateKey = await generatePrivateKey();
|
|
41
|
+
|
|
42
|
+
// convert the private key to a PEM format
|
|
43
|
+
const { privPem } = await privateKeyToPEM(privateKey);
|
|
44
|
+
|
|
45
|
+
console.log(privPem);
|
|
46
|
+
|
|
47
|
+
// create a self-sign certificate
|
|
48
|
+
const { cert } = await createSelfSignedCertificate({
|
|
49
|
+
privateKey,
|
|
50
|
+
notAfter: new Date(2025, 1, 1),
|
|
51
|
+
notBefore: new Date(2019, 1, 1),
|
|
52
|
+
subject: "CN=Test",
|
|
53
|
+
dns: ["DNS1", "DNS2"],
|
|
54
|
+
ip: ["192.168.1.1"],
|
|
55
|
+
applicationUri: "urn:HOSTNAME:ServerDescription",
|
|
56
|
+
purpose: CertificatePurpose.ForApplication,
|
|
57
|
+
});
|
|
58
|
+
console.log(cert);
|
|
59
|
+
}
|
|
60
|
+
demonstratePrivateKeyAndSelfSignedCertificateCreation();
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Please refer to the examples directory for more specific use cases and comprehensive samples.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Support
|
|
69
|
+
|
|
70
|
+
For any inquiries or issues related to NodeOPCUA Crypto, you can contact us at contact@sterfive.com. Please note that priority support is available to NodeOPCUA Support Subscription members.
|
|
71
|
+
|
|
72
|
+
### Getting professional support
|
|
73
|
+
|
|
74
|
+
NodeOPCUA PKI is developed and maintained by sterfive.com.
|
|
75
|
+
|
|
76
|
+
To get professional support, consider subscribing to the node-opcua membership community:
|
|
77
|
+
|
|
78
|
+
[](https://support.sterfive.com)
|
|
79
|
+
|
|
80
|
+
or contact [sterfive](https://www.sterfive.com) for dedicated consulting and more advanced support.
|
|
81
|
+
|
|
82
|
+
## Contributing
|
|
83
|
+
|
|
84
|
+
We appreciate contributions from the community. To contribute:
|
|
85
|
+
|
|
86
|
+
* Fork the repository.
|
|
87
|
+
* Create a new branch.
|
|
88
|
+
* Commit your changes.
|
|
89
|
+
* Submit a pull request.
|
|
90
|
+
* Sign the CLA (Contributor Licence Agreement) form
|
|
91
|
+
|
|
92
|
+
For more detailed instructions, refer to the CONTRIBUTING.md file.
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
NodeOPCUA Crypto is MIT licensed. See the LICENSE file for full license details.
|
|
97
|
+
|
|
98
|
+
Copyright © 2023-2024 Sterfive.com.
|
|
99
|
+
|
|
100
|
+
## Disclaimer
|
|
101
|
+
|
|
102
|
+
NodeOPCUA Crypto is provided as-is, and while we strive to ensure its quality and security, Sterfive.com cannot be held liable for any damage caused directly or indirectly by the usage of this module.
|
|
103
|
+
|
|
104
|
+
Please report any issues or vulnerabilities you find via the issue tracker.
|
|
105
|
+
|
|
106
|
+
Thank you for considering NodeOPCUA Crypto for your OPCUA cryptography needs. We look forward to seeing what you build with i
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Supporting the development effort - Sponsors & Backers
|
|
111
|
+
|
|
112
|
+
If you like `node-opcua-pki` and if you are relying on it in one of your projects, please consider becoming a backer and [sponsoring us](https://github.com/sponsors/node-opcua), this will help us to maintain a high-quality stack and constant evolution of this module.
|
|
113
|
+
|
|
114
|
+
If your company would like to participate and influence the development of future versions of `node-opcua` please contact [sterfive](mailto:contact@sterfive.com).
|
|
@@ -2,8 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
3
3
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
4
4
|
}) : x)(function(x) {
|
|
5
|
-
if (typeof require !== "undefined")
|
|
6
|
-
return require.apply(this, arguments);
|
|
5
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
6
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
7
|
});
|
|
9
8
|
var __export = (target, all) => {
|
|
@@ -748,12 +747,10 @@ function publicEncrypt_long(buffer, publicKey, blockSize, padding, paddingAlgori
|
|
|
748
747
|
}
|
|
749
748
|
if (paddingAlgorithm === RSA_PKCS1_PADDING) {
|
|
750
749
|
padding = padding || 11;
|
|
751
|
-
if (padding !== 11)
|
|
752
|
-
throw new Error("padding should be 11");
|
|
750
|
+
if (padding !== 11) throw new Error("padding should be 11");
|
|
753
751
|
} else if (paddingAlgorithm === RSA_PKCS1_OAEP_PADDING) {
|
|
754
752
|
padding = padding || 42;
|
|
755
|
-
if (padding !== 42)
|
|
756
|
-
throw new Error("padding should be 42");
|
|
753
|
+
if (padding !== 42) throw new Error("padding should be 42");
|
|
757
754
|
} else {
|
|
758
755
|
throw new Error("Invalid padding algorithm " + paddingAlgorithm);
|
|
759
756
|
}
|
|
@@ -1726,8 +1723,7 @@ var enquoteIfNecessary = (str) => {
|
|
|
1726
1723
|
};
|
|
1727
1724
|
var unquote = (str) => str.replace(/"/gm, "");
|
|
1728
1725
|
var unquote2 = (str) => {
|
|
1729
|
-
if (!str)
|
|
1730
|
-
return str;
|
|
1726
|
+
if (!str) return str;
|
|
1731
1727
|
const m = str.match(/^"(.*)"$/);
|
|
1732
1728
|
return m ? m[1] : str;
|
|
1733
1729
|
};
|
|
@@ -6261,4 +6257,4 @@ asn1js/build/index.es.js:
|
|
|
6261
6257
|
*
|
|
6262
6258
|
*)
|
|
6263
6259
|
*/
|
|
6264
|
-
//# sourceMappingURL=chunk-
|
|
6260
|
+
//# sourceMappingURL=chunk-VAMKYXNP.mjs.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
privateKeyToPEM,
|
|
7
7
|
removeTrailingLF,
|
|
8
8
|
toPem
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VAMKYXNP.mjs";
|
|
10
10
|
|
|
11
11
|
// source_nodejs/read.ts
|
|
12
12
|
import assert from "assert";
|
|
@@ -170,4 +170,4 @@ export {
|
|
|
170
170
|
generatePrivateKeyFile,
|
|
171
171
|
generatePrivateKeyFileAlternate
|
|
172
172
|
};
|
|
173
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-WYY6WVVJ.mjs.map
|
package/dist/index.js
CHANGED
|
@@ -1232,12 +1232,10 @@ function publicEncrypt_long(buffer, publicKey, blockSize, padding, paddingAlgori
|
|
|
1232
1232
|
}
|
|
1233
1233
|
if (paddingAlgorithm === RSA_PKCS1_PADDING) {
|
|
1234
1234
|
padding = padding || 11;
|
|
1235
|
-
if (padding !== 11)
|
|
1236
|
-
throw new Error("padding should be 11");
|
|
1235
|
+
if (padding !== 11) throw new Error("padding should be 11");
|
|
1237
1236
|
} else if (paddingAlgorithm === RSA_PKCS1_OAEP_PADDING) {
|
|
1238
1237
|
padding = padding || 42;
|
|
1239
|
-
if (padding !== 42)
|
|
1240
|
-
throw new Error("padding should be 42");
|
|
1238
|
+
if (padding !== 42) throw new Error("padding should be 42");
|
|
1241
1239
|
} else {
|
|
1242
1240
|
throw new Error("Invalid padding algorithm " + paddingAlgorithm);
|
|
1243
1241
|
}
|
|
@@ -1845,8 +1843,7 @@ var enquoteIfNecessary = (str) => {
|
|
|
1845
1843
|
};
|
|
1846
1844
|
var unquote = (str) => str.replace(/"/gm, "");
|
|
1847
1845
|
var unquote2 = (str) => {
|
|
1848
|
-
if (!str)
|
|
1849
|
-
return str;
|
|
1846
|
+
if (!str) return str;
|
|
1850
1847
|
const m = str.match(/^"(.*)"$/);
|
|
1851
1848
|
return m ? m[1] : str;
|
|
1852
1849
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readPublicKeyPEM,
|
|
15
15
|
readPublicRsaKey,
|
|
16
16
|
setCertificateStore
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WYY6WVVJ.mjs";
|
|
18
18
|
import "./chunk-5NV4OKIV.mjs";
|
|
19
19
|
import {
|
|
20
20
|
CertificatePurpose,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
verifyChunkSignature,
|
|
111
111
|
verifyChunkSignatureWithDerivedKeys,
|
|
112
112
|
verifyMessageChunkSignature
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-VAMKYXNP.mjs";
|
|
114
114
|
export {
|
|
115
115
|
CertificatePurpose,
|
|
116
116
|
PaddingAlgorithm,
|
package/dist/index_web.js
CHANGED
|
@@ -1217,12 +1217,10 @@ function publicEncrypt_long(buffer, publicKey, blockSize, padding, paddingAlgori
|
|
|
1217
1217
|
}
|
|
1218
1218
|
if (paddingAlgorithm === RSA_PKCS1_PADDING) {
|
|
1219
1219
|
padding = padding || 11;
|
|
1220
|
-
if (padding !== 11)
|
|
1221
|
-
throw new Error("padding should be 11");
|
|
1220
|
+
if (padding !== 11) throw new Error("padding should be 11");
|
|
1222
1221
|
} else if (paddingAlgorithm === RSA_PKCS1_OAEP_PADDING) {
|
|
1223
1222
|
padding = padding || 42;
|
|
1224
|
-
if (padding !== 42)
|
|
1225
|
-
throw new Error("padding should be 42");
|
|
1223
|
+
if (padding !== 42) throw new Error("padding should be 42");
|
|
1226
1224
|
} else {
|
|
1227
1225
|
throw new Error("Invalid padding algorithm " + paddingAlgorithm);
|
|
1228
1226
|
}
|
|
@@ -1830,8 +1828,7 @@ var enquoteIfNecessary = (str) => {
|
|
|
1830
1828
|
};
|
|
1831
1829
|
var unquote = (str) => str.replace(/"/gm, "");
|
|
1832
1830
|
var unquote2 = (str) => {
|
|
1833
|
-
if (!str)
|
|
1834
|
-
return str;
|
|
1831
|
+
if (!str) return str;
|
|
1835
1832
|
const m = str.match(/^"(.*)"$/);
|
|
1836
1833
|
return m ? m[1] : str;
|
|
1837
1834
|
};
|
package/dist/index_web.mjs
CHANGED
package/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./dist/index.mjs";
|
|
1
|
+
export * from "./dist/index.mjs";
|
package/index_web.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./source/index.js";
|
|
1
|
+
export * from "./source/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-crypto",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.1",
|
|
4
4
|
"description": "Crypto tools for Node-OPCUA",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"node": ">15.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^20.
|
|
49
|
+
"@types/node": "^20.14.10",
|
|
50
50
|
"lorem-ipsum": "^2.0.8"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@peculiar/webcrypto": "^1.
|
|
54
|
-
"@peculiar/x509": "^1.
|
|
55
|
-
"@types/jsrsasign": "^10.5.
|
|
53
|
+
"@peculiar/webcrypto": "^1.5.0",
|
|
54
|
+
"@peculiar/x509": "^1.11.0",
|
|
55
|
+
"@types/jsrsasign": "^10.5.14",
|
|
56
56
|
"@types/sshpk": "^1.17.4",
|
|
57
57
|
"assert": "^2.1.0",
|
|
58
58
|
"chalk": "^4.1.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"bugs": {
|
|
68
68
|
"url": "https://github.com/node-opcua/node-opcua-crypto/issues"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "d74f3803cf4097d21bc238d195a126f0f28ae24b"
|
|
71
71
|
}
|