ocsp-hashes
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

OCSP-hashes generator: Node.js

Creates ocsp hashes for certificate revocation check from pem encoded certificates.

##Publications:

https://blog.appit-online.de/publications/

Table of contents:

Quickstart

Installing the library

npm install ocsp-hashes --save

Using the library

import * as ocspHashes from 'ocsp-hashes';

/**
 * Given a pem certificate file and issuer cert file.
 * @param {string} certPath The path to a certificate file.
 * @param {string} issuerCertPath The path to a issuer certificate file.
 * @param {string} hashingAlgorithm - default sha256.
 * @param {boolean} disableFilePathValidations - default false - only for development or if you know what you are doing.
 */
const ocspHashes = await ocspHashes.getOCSPHashes(certPath, issuerCertPath, hashingAlgorithm, disableFilePathValidations);
console.log('The ocsp object:');
console.log(ocspHashes);

const ocspHashes = await ocspHashes.getOCSPHashes(certPath, issuerCertPath, hashingAlgorithm);
console.log('The ocsp object:');
console.log(ocspHashes);

const ocspHashes = await ocspHashes.getOCSPHashes(certPath, issuerCertPath);
console.log('The ocsp object:');
console.log(ocspHashes);


/*
{
        "hashAlgorithm": "sha256",
        "issuerNameHash": "C3898FF2BAFB7FD5F83CE0A25AC731A8D78898874FF17EA3EC01FAEF11F1E7B8",
        "issuerKeyHash": "7B6C1816B110889887019E8AF43267675B95D9EAC75A4476A0C259EB090EF705",
        "serialNumber": "256E8AF6A2AD1F14E69843888F5D78C1"
}
*/

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js.

License

Apache Version 2.0

See LICENSE

Package Sidebar

Install

npm i ocsp-hashes

Weekly Downloads

14

Version

1.0.1

License

ISC

Unpacked Size

18.3 kB

Total Files

7

Last publish

Collaborators

  • dave7117