node-opcua-crypto 4.9.4 → 4.11.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.
- package/LICENSE +23 -23
- package/README.md +119 -114
- package/dist/{chunk-WLW5XUML.mjs → chunk-2RCYFHGG.mjs} +755 -724
- package/dist/chunk-2RCYFHGG.mjs.map +1 -0
- package/dist/chunk-C7PROBPE.mjs +14 -0
- package/dist/chunk-C7PROBPE.mjs.map +1 -0
- package/dist/{chunk-UEV3YRUV.mjs → chunk-UH5AT3JE.mjs} +9 -15
- package/dist/chunk-UH5AT3JE.mjs.map +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +553 -552
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -52
- package/dist/index_web-C5Oeu9mq.d.mts +503 -0
- package/dist/index_web-D1qc4UN2.d.ts +503 -0
- package/dist/source/index.d.mts +11 -516
- package/dist/source/index.d.ts +11 -516
- package/dist/source/index.js +537 -529
- package/dist/source/index.js.map +1 -1
- package/dist/source/index.mjs +9 -50
- package/dist/source/index_web.d.mts +1 -1
- package/dist/source/index_web.d.ts +1 -1
- package/dist/source/index_web.js +525 -522
- package/dist/source/index_web.js.map +1 -1
- package/dist/source/index_web.mjs +5 -49
- package/dist/source_nodejs/index.d.mts +1 -2
- package/dist/source_nodejs/index.d.ts +1 -2
- package/dist/source_nodejs/index.js +33 -41
- package/dist/source_nodejs/index.js.map +1 -1
- package/dist/source_nodejs/index.mjs +3 -5
- package/package.json +9 -4
- package/dist/chunk-5NV4OKIV.mjs +0 -1
- package/dist/chunk-5NV4OKIV.mjs.map +0 -1
- package/dist/chunk-UEV3YRUV.mjs.map +0 -1
- package/dist/chunk-WLW5XUML.mjs.map +0 -1
- package/dist/index_web.d.mts +0 -4
- package/dist/index_web.d.ts +0 -4
- package/dist/index_web.js +0 -6365
- package/dist/index_web.js.map +0 -1
- package/dist/index_web.mjs +0 -192
- package/dist/index_web.mjs.map +0 -1
- package/index.mjs +0 -1
- package/index_web.ts +0 -1
- package/web.d.ts +0 -1
- package/web.mjs +0 -1
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,119 @@
|
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
+
Sterfive provides this module free of charge, "as is," with the hope that it will be useful to you. However, any support requests, bug fixes, or enhancements are handled exclusively through our paid services. We believe strongly that independent open-source companies should be fairly compensated for their contributions to the community.
|
|
71
|
+
|
|
72
|
+
We highly recommend subscribing to our support program to ensure your requests are addressed and resolved. Please note that we only consider requests from members of our support program or sponsors.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Getting professional support
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
NodeOPCUA Crypto is developed and maintained by sterfive.com.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
To get professional support, consider subscribing to the node-opcua membership community:
|
|
82
|
+
|
|
83
|
+
[](https://support.sterfive.com)
|
|
84
|
+
|
|
85
|
+
or contact [sterfive](https://www.sterfive.com) for dedicated consulting and more advanced support.
|
|
86
|
+
|
|
87
|
+
## Contributing
|
|
88
|
+
|
|
89
|
+
We appreciate contributions from the community. To contribute:
|
|
90
|
+
|
|
91
|
+
* Fork the repository.
|
|
92
|
+
* Create a new branch.
|
|
93
|
+
* Commit your changes.
|
|
94
|
+
* Submit a pull request.
|
|
95
|
+
* Sign the CLA (Contributor Licence Agreement) form
|
|
96
|
+
|
|
97
|
+
For more detailed instructions, refer to the CONTRIBUTING.md file.
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
NodeOPCUA Crypto is MIT licensed. See the LICENSE file for full license details.
|
|
102
|
+
|
|
103
|
+
Copyright © 2023-2024 Sterfive.com.
|
|
104
|
+
|
|
105
|
+
## Disclaimer
|
|
106
|
+
|
|
107
|
+
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.
|
|
108
|
+
|
|
109
|
+
Please report any issues or vulnerabilities you find via the issue tracker.
|
|
110
|
+
|
|
111
|
+
Thank you for considering NodeOPCUA Crypto for your OPCUA cryptography needs. We look forward to seeing what you build with i
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## Supporting the development effort - Sponsors & Backers
|
|
116
|
+
|
|
117
|
+
If you like `node-opcua-crypto` and if you are relying on it in one of your projects, please consider becoming a backer and [sponsoring us](https://opencollective.com/node-opcua), this will help us to maintain a high-quality stack and constant evolution of this module.
|
|
118
|
+
|
|
119
|
+
If your company would like to participate and influence the development of future versions of `node-opcua` and its components, please contact [sterfive](mailto:contact@sterfive.com).
|