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

acme-protocol

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acme-protocol

Automatic Certificate Management Environment (ACME) Protocol

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by44.44%
Maintainers
1
Weekly downloads
 
Created
Source

ACME Protocol

npm npm license npm downloads build status

This module aims to implement the Automatic Certificate Management Environment (ACME) Protocol, with compatibility for both, the currently employed (e.g. by LetsEncrypt), and the currently being specified version.

Install via npm

$ npm install --save acme-protocol

Usage

var ACME = require( 'acme-protocol' )
// Create a new ACME protocol client
var client = new ACME({
  baseUrl: 'https://acme-staging.api.letsencrypt.org',
  publicKey: '...', // PEM encoded public key (required)
  privateKey: '...', // PEM encoded private key (required)
})
// Configure the client with the ACME server's directory
// NOTE: Optional, will be done on API if unconfigured
client.configure( function( error, directory ) {
  // directory -> {
  //   'new-authz': 'https://acme-staging.api.letsencrypt.org/acme/new-authz',
  //   'new-cert': 'https://acme-staging.api.letsencrypt.org/acme/new-cert',
  //   'new-reg': 'https://acme-staging.api.letsencrypt.org/acme/new-reg',
  //   'revoke-cert': 'https://acme-staging.api.letsencrypt.org/acme/revoke-cert'
  // }
})
// Retrieve a new replay-nonce to be used
client.getNonce( function( error, replayNonce ) {
  // ...
})
// Define your contact details
var contact = [ 'mailto:root@localhost' ]

// Register a new account for defined contact and
// keys the client was initialized with
client.register( contact, function( error, registration ) {
  // client.registrationUrl = registration ->
  //   'https://acme-staging.api.letsencrypt.org/acme/reg/246840'
})
// Create a registration update with `agreement` set
// NOTE: The client's `key` will be added to this registration update
// automatically by the client
var registration = {
  resource: ACME.REGISTRATION,
  contact: client.registration.contact.slice(),
  agreement: 'https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf',
}

// Update your registration with agreement to TOS
client.updateRegistration( registration, function( error, registration ) {
  // client.registration = registration -> {
  //   id: 246840,
  //   key: {
  //     kty: 'RSA',
  //     n: 'oL9U7lsMfBGZiFO_NmvTbPlPaMgMfg9iuxO2IkgKrJbKVtrGvfzNCOMIaO_wAx8AIf3-tegeaEWWV6FyO6haW1zPhKovVAYyXQKof8CKvueooTie46d0JAHirdAGWn2BWCQKQ-GlFqqMx2ou1BHv9MxfGKaT9CjT8cIROl1ptag3kdUH5ZsjhGmdg_TNXeu4wtiYVf0JG9nWfZncX4Dgv6IpSCoQiGf6FIE_q0jaUhpdBdQ6HEL_s6O3L45FFYvGfAuiciuKVZugR3hXCUJ26NmShMKfdu5qUKPQ02-IQAFGncnMNOVPeDhkLMMIaNerGCsjVz1l_TjXOSTW-h1paw',
  //     e: 'AQAB'
  //   },
  //   contact: [ 'mailto:cert-admin@example.com' ],
  //   agreement: 'https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf',
  //   initialIp: '217.246.162.70',
  //   createdAt: '2016-07-05T22:28:50Z'
  // }
})

Keywords

FAQs

Package last updated on 24 Jul 2016

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