
Security News
Python Adopts Standard Lock File Format for Reproducible Installs
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
@pulumi/tls
Advanced tools
@pulumi/tls is an npm package that provides TLS (Transport Layer Security) utilities for managing and creating TLS certificates and keys. It is part of the Pulumi ecosystem, which allows for infrastructure as code using familiar programming languages.
Creating a Self-Signed Certificate
This feature allows you to create a self-signed certificate using the @pulumi/tls package. The code sample demonstrates how to generate a private key and then use it to create a self-signed certificate.
const tls = require('@pulumi/tls');
const privateKey = new tls.PrivateKey('example', { algorithm: 'RSA', rsaBits: 2048 });
const selfSignedCert = new tls.SelfSignedCert('example', {
keyAlgorithm: 'RSA',
privateKeyPem: privateKey.privateKeyPem,
subjects: [{ commonName: 'example.com' }],
validityPeriodHours: 8760,
allowedUses: ['keyEncipherment', 'digitalSignature', 'serverAuth']
});
exports.certPem = selfSignedCert.certPem;
Creating a Private Key
This feature allows you to create a private key. The code sample shows how to generate an RSA private key with a specified number of bits.
const tls = require('@pulumi/tls');
const privateKey = new tls.PrivateKey('example', { algorithm: 'RSA', rsaBits: 2048 });
exports.privateKeyPem = privateKey.privateKeyPem;
Creating a Certificate Signing Request (CSR)
This feature allows you to create a Certificate Signing Request (CSR). The code sample demonstrates how to generate a CSR using a private key and subject information.
const tls = require('@pulumi/tls');
const privateKey = new tls.PrivateKey('example', { algorithm: 'RSA', rsaBits: 2048 });
const csr = new tls.CertRequest('example', {
keyAlgorithm: 'RSA',
privateKeyPem: privateKey.privateKeyPem,
subjects: [{ commonName: 'example.com' }]
});
exports.csrPem = csr.certRequestPem;
node-forge is a JavaScript library that provides a native implementation of TLS, PKI, and various cryptographic utilities. It is more general-purpose compared to @pulumi/tls, which is specifically designed for infrastructure as code scenarios.
pem is a simple library for creating and managing PEM encoded certificates and keys. It provides functionalities similar to @pulumi/tls but is more focused on basic certificate and key management rather than integration with infrastructure as code.
openssl-wrapper is a Node.js wrapper for the OpenSSL command-line tool. It allows you to perform various cryptographic operations, including creating certificates and keys. While it offers similar functionalities, it relies on the OpenSSL binary and is not as tightly integrated with infrastructure as code workflows as @pulumi/tls.
The TLS resource provider for Pulumi lets you create TLS keys and certificates in your cloud programs. To use this package, please install the Pulumi CLI first.
This package is available in many languages in the standard packaging formats.
To use from JavaScript or TypeScript in Node.js, install using either npm
:
$ npm install @pulumi/tls
or yarn
:
$ yarn add @pulumi/tls
To use from Python, install using pip
:
$ pip install pulumi_tls
To use from Go, use go get
to grab the latest version of the library
$ go get github.com/pulumi/pulumi-tls/sdk/v5
To use from .NET, install using dotnet add package
:
$ dotnet add package Pulumi.Tls
The @pulumi/tls
package provides a strongly-typed means to build cloud applications that create
and interact closely with TLS resources.
For further information, please visit the TLS provider docs or for detailed reference documentation, please visit the API docs.
FAQs
A Pulumi package to create TLS resources in Pulumi programs.
The npm package @pulumi/tls receives a total of 326,025 weekly downloads. As such, @pulumi/tls popularity was classified as popular.
We found that @pulumi/tls demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Python has adopted a standardized lock file format to improve reproducibility, security, and tool interoperability across the packaging ecosystem.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.