https://github.com/node-opcua/node-opcua-crypto
node-opcua certificate tools & encryption/signature support
https://github.com/node-opcua/node-opcua-crypto
certificate encryption opcua security
Last synced: about 1 month ago
JSON representation
node-opcua certificate tools & encryption/signature support
- Host: GitHub
- URL: https://github.com/node-opcua/node-opcua-crypto
- Owner: node-opcua
- License: mit
- Created: 2015-12-23T21:24:08.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T02:56:01.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T09:04:48.131Z (almost 2 years ago)
- Topics: certificate, encryption, opcua, security
- Language: TypeScript
- Homepage:
- Size: 1.35 MB
- Stars: 5
- Watchers: 4
- Forks: 11
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# node-opcua-crypto
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.
[](https://www.npmtrends.com/node-opcua-crypto)
[](https://www.npmjs.com/package/node-opcua-crypto?activeTab=versions)
[](https://github.com/node-opcua/node-opcua-crypto/actions/workflows/main.yml)
[](https://codeclimate.com/github/node-opcua/node-opcua-crypto)
[](https://coveralls.io/github/node-opcua/node-opcua-crypto?branch=master)
[](https://packagephobia.com/result?p=node-opcua-crypto)
[](https://app.fossa.com/projects/custom%2B20248%2Fgithub.com%2Fnode-opcua%2Fnode-opcua-crypto?ref=badge_shield)
## Features
- a comprehensive set of cryptographic functionalities.
- supports both Node.js and browser environments.
- compatible with TypeScript for robust, type-safe coding.
- implements advanced security standards for OPCUA.
## Getting Started
To use NodeOPCUA Crypto in your project, follow these steps:
#### Installation
```bash
npm install nodeopcua-crypto
```
### Usage
```bash
import { generatePrivateKey, privateKeyToPEM, CertificatePurpose, createSelfSignedCertificate } from "./node-opcua-crypto.js";
async function demonstratePrivateKeyAndSelfSignedCertificateCreation() {
// create the Private Key
const privateKey = await generatePrivateKey();
// convert the private key to a PEM format
const { privPem } = await privateKeyToPEM(privateKey);
console.log(privPem);
// create a self-sign certificate
const { cert } = await createSelfSignedCertificate({
privateKey,
notAfter: new Date(2025, 1, 1),
notBefore: new Date(2019, 1, 1),
subject: "CN=Test",
dns: ["DNS1", "DNS2"],
ip: ["192.168.1.1"],
applicationUri: "urn:HOSTNAME:ServerDescription",
purpose: CertificatePurpose.ForApplication,
});
console.log(cert);
}
demonstratePrivateKeyAndSelfSignedCertificateCreation();
```
Please refer to the examples directory for more specific use cases and comprehensive samples.
## Support
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.
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.
### Getting professional support
NodeOPCUA Crypto is developed and maintained by sterfive.com.
To get professional support, consider subscribing to the node-opcua membership community:
[](https://support.sterfive.com)
or contact [sterfive](https://www.sterfive.com) for dedicated consulting and more advanced support.
## Contributing
We appreciate contributions from the community. To contribute:
- Fork the repository.
- Create a new branch.
- Commit your changes.
- Submit a pull request.
- Sign the CLA (Contributor Licence Agreement) form
For more detailed instructions, refer to the CONTRIBUTING.md file.
## License
NodeOPCUA Crypto is MIT licensed. See the [LICENSE file](./LICENSE) for full license details.
Copyright © 2023-2026 Sterfive.com.
## Disclaimer
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.
Please report any issues or vulnerabilities you find via the issue tracker.
Thank you for considering NodeOPCUA Crypto for your OPCUA cryptography needs. We look forward to seeing what you build with i
## Supporting the development effort - Sponsors & Backers
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.
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).