Generate a CSR (Certificate Signing Request) for a Free SSL Certificate in your browser! Uses as few dependencies as possible from the PKI.js and ASN1.js suites.
Go to file
AJ ONeal 3e2b516f37 update description 2018-04-30 23:43:58 -06:00
LICENSE add LICENSE 2018-04-30 17:33:34 -06:00
README.md update description 2018-04-30 23:43:58 -06:00
csr.js v1.0.0-alpha 2018-04-30 17:31:26 -06:00
package.json v1.0.0-alpha 2018-04-30 17:31:26 -06:00

README.md

browser-csr

Generate a Certificate Signing Request (CSR) in your browser!

Used for Let's Encrypt v2 with greenlock.html.

Uses as few dependencies as possible from the PKI.js and ASN1.js suites and supports SAN AltNames.

Usage

<script src="/js/browser-csr.js"></script>
CSR.generate({

  /* A WebCrypto-generated keypair */
  keypair: {}

  /* Subject & SANS altnames */
, domains: [ 'example.com', 'www.example.com' ]

, format: 'rfc7515' // unpadded urlsafe base64

}).then(function (csrweb64) {
  console.log(csrweb64);
});

Dependencies

pkijs@v1.3.33

<script src="https://coolaj86.com/assets/media/examples/pkijs.org/v1.3.33/org/pkijs/common.js"></script>
<script src="https://coolaj86.com/assets/media/examples/pkijs.org/v1.3.33/org/pkijs/asn1.js"></script>
<script src="https://coolaj86.com/assets/media/examples/pkijs.org/v1.3.33/org/pkijs/x509_schema.js"></script>
<script src="https://coolaj86.com/assets/media/examples/pkijs.org/v1.3.33/org/pkijs/x509_simpl.js"></script>