Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "x509", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Simple X509 certificate parser.", | ||
@@ -5,0 +5,0 @@ "author": "Colton Baker", |
node-x509 | ||
========= | ||
[![Build Status](https://travis-ci.org/Southern/node-x509.svg)](https://travis-ci.org/Southern/node-x509) | ||
Simple X509 certificate parser. | ||
*support Node.js 4.0.0* | ||
Simple X509 certificate parser. | ||
## Installation | ||
@@ -22,5 +23,4 @@ | ||
```js | ||
var x509 = require('x509'); | ||
var issuer = x509.getIssuer(__dirname + '/certs/your.crt'); | ||
const x509 = require('x509'); | ||
const issuer = x509.getIssuer(__dirname + '/certs/your.crt'); | ||
``` | ||
@@ -30,6 +30,5 @@ | ||
```js | ||
var fs = require('fs'), | ||
x509 = require('x509'); | ||
var issuer = x509.getIssuer(fs.readFileSync('./certs/your.crt').toString()); | ||
const fs = require('fs'); | ||
const x509 = require('x509'); | ||
const issuer = x509.getIssuer(fs.readFileSync('./certs/your.crt').toString()); | ||
``` | ||
@@ -41,3 +40,2 @@ | ||
#### x509.getAltNames(`cert`) | ||
@@ -47,5 +45,4 @@ Parse certificate with `x509.parseCert` and return the alternate names. | ||
```js | ||
var x509 = require('x509'); | ||
var altNames = x509.getAltNames(__dirname + '/certs/nodejitsu.com.crt'); | ||
const x509 = require('x509'); | ||
const altNames = x509.getAltNames(__dirname + '/certs/nodejitsu.com.crt'); | ||
/* | ||
@@ -60,5 +57,4 @@ altNames = [ '*.nodejitsu.com', 'nodejitsu.com' ] | ||
```js | ||
var x509 = require('x509'); | ||
var issuer = x509.getIssuer(__dirname + '/certs/nodejitsu.com.crt'); | ||
const x509 = require('x509'); | ||
const issuer = x509.getIssuer(__dirname + '/certs/nodejitsu.com.crt'); | ||
/* | ||
@@ -77,5 +73,4 @@ issuer = { countryName: 'GB', | ||
```js | ||
var x509 = require('x509'); | ||
var subject = x509.getSubject(__dirname + '/certs/nodejitsu.com.crt'); | ||
const x509 = require('x509'); | ||
const subject = x509.getSubject(__dirname + '/certs/nodejitsu.com.crt'); | ||
/* | ||
@@ -97,5 +92,4 @@ subject = { countryName: 'US', | ||
```js | ||
var x509 = require('x509'); | ||
var cert = x509.parseCert(__dirname + '/certs/nodejitsu.com.crt'); | ||
const x509 = require('x509'); | ||
const cert = x509.parseCert(__dirname + '/certs/nodejitsu.com.crt'); | ||
/* | ||
@@ -132,5 +126,5 @@ cert = { subject: | ||
```js | ||
var x509 = require('x509'), | ||
cert = x509.parseCert('yourcert.crt'), | ||
date = new Date(); | ||
const x509 = require('x509'), | ||
const cert = x509.parseCert('yourcert.crt'), | ||
const date = new Date(); | ||
@@ -137,0 +131,0 @@ if (cert.notBefore > date) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
452764
137