New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aws-pca

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-pca

A library to generate a certificate for HTTPS use using AWS Private Certificate Authority (PCA)

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

node-aws-pca

npm version

A library to generate and fetch a certificate for HTTPS use using AWS Private Certificate Authority (PCA).

Install

Required:

  • aws-sdk for calling AWS

npm i aws-pca aws-sdk

Notice

Depending on your perspective, AWS PCA can be expensive. As of current writing, maintaining a PCA CA runs at $400.00 USD / mo, while each created certificate is $0.75 USD. Be aware that using this library to create certificiates carries a cost. I am not responsible for any charges incurred by using this library. You are responsible for understanding the costs of running the PCA.

Usage

For more documentation, see source code and tests in src/

// The following has been personally tested to work

const AWS = require('aws-sdk')
const PCA = require('aws-pca').PCA

export async function sample () {
  // The value of your CA (Certificate Authority) ARN in AWS PCA
  const CA_ARN = 'arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/4819f73f-af7c-4abf-8753-62e40512cac6'

  const pca = new PCA(AWS, CA_ARN)

  // Get the CA certificate if you need to add it to your trust stores
  const caData = await pca.getCaCertificate()

  console.log('Certificate Authority Data')
  console.log(caData)
  console.log('--------')

  // Create the server certificate
  const reqCertRes = await pca.requestCertificate({
    DomainName: 'test.int',
    SubjectAlternativeNames: ['blah.test.int']
  })

  console.log('Request Certificate Response')
  console.log(reqCertRes)
  console.log('--------')

  const cert = await pca.exportCertificate(reqCertRes.CertificateArn, 'password-to-set-for-the-key')

  console.log('Server Certificate')
  console.log(cert)
}

sample().then((c) => {
  process.exit(0)
}).catch((e) => {
  console.error(e)
  process.exit(-1)
})

Keywords

FAQs

Package last updated on 16 Jan 2019

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