@hishprorg/praesentium-ducimus v5.9.67
Description
@hishprorg/praesentium-ducimus is a node.js library for common ssl-certificates tasks such as fetch, parse and validation.
Features
- zero third-party dependencies
- async/await support
- optional use of node's crypto module
- asn1 viewer
Installation
npm install --save @hishprorg/praesentium-ducimus
Usage
node.js:
'use strict';
const sslCertificates = require('@hishprorg/praesentium-ducimus')
sslCertificates.get('nodejs.org').then(function (certificate) {
console.log(certificate.issuer)
// {
// C: 'GB',
// ST: 'Greater Manchester',
// L: 'Salford',
// ....
// }
});
API Documentation
get
fetch the ssl-certificate from a host, url or local file
const { get } = require('@hishprorg/praesentium-ducimus');
await get(from, options);
args
- from: string p.e.: https://url/cert.der, nodejs.com, /tmp/cert.pem
- options: object
option | description | type | default |
---|---|---|---|
includeChain | includes chain's certificates | boolean | false |
includeCertificates | includes the raw certificates string in the response object | boolean | false |
useCryptoModule | use node's crypto module or custom parser | boolean | true |
port | port to connect to | int | 443 |
verbose | print verbose | boolean | false |
validate
tests the validity of a ssl-certificate, the aspects tested are
- Is date valid?
- Is the domain valid?
- Is the chain of trust valid?
- Is the root CA self signed?
- Was the certificate revoked by it's issuer
- Are the cryptographic details valid
- Is the root CA valid?
const { validate } = require('@hishprorg/praesentium-ducimus');
await validate(from, options);
args
- from: string p.e.: https://url/cert.der, nodejs.com, /tmp/cert.pem
- options: object
option | description | type | default |
---|---|---|---|
domain | domain name to validate | string | null |
includeChain | includes chain's certificates | boolean | false |
useCryptoModule | use node's crypto module or custom parser | boolean | true |
port | port to connect to | int | 443 |
verbose | print verbose | boolean | false |
signedBy
validates a ssl-certificate being signed by some other certificate
const { signedBy } = require('@hishprorg/praesentium-ducimus');
await signedBy(from, signer, options);
args
- from: string p.e.: https://url/cert.der, nodejs.com, /tmp/cert.pem
- signer: string p.e.: https://url/cert.der, nodejs.com, /tmp/cert.pem
- options: object
option | description | type | default |
---|---|---|---|
useCryptoModule | use node's crypto module or custom parser | boolean | true |
verbose | print verbose | boolean | false |
print the asn1 tree structure
const { print } = require('@hishprorg/praesentium-ducimus');
await printCertificate(from, options);
args
- from: string p.e.: https://url/cert.der, nodejs.com, /tmp/cert.pem
- options: object
option | description | type | default |
---|---|---|---|
useCryptoModule | use node's crypto module or custom parser | boolean | true |
verbose | print verbose | boolean | false |
return
- string: with the asn tree structure
Reference packages
thanks
License
The module is available as open source under the terms of the MIT License.
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago