Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pulumi/tls

Package Overview
Dependencies
Maintainers
2
Versions
370
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pulumi/tls

A Pulumi package to create TLS resources in Pulumi programs.

  • 5.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is @pulumi/tls?

@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.

What are @pulumi/tls's main functionalities?

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;

Other packages similar to @pulumi/tls

Keywords

FAQs

Package last updated on 16 Oct 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc