0.2.0 • Published 28 days ago

typepki-oiddb v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
28 days ago

typepki-oiddb: Object Identifier (OID) database and utilities for TypePKI Library

TOP | github | npm | TypePKI

The 'TypePKI' library is an opensource free TypeScript PKI library which is the successor of the long lived jsrsasign library.

The 'typepki-oiddb' is a Object Identifier (OID) database and utilities for TypePKI Library.

FEATURE

  • singleton OID database
  • Dual CommonJS/ES module package supporting CommonJS(CJS) and ES modules

Usage

import { OIDDataBase, OIDSET_CRYPTO, OIDSET_X509 } from "typepki-oiddb";
const oiddb = OIDDatabase.instance; // singleton object
oiddb.regist([OIDSET_CRYPTO, OIDSET_X509]);
oiddb.oidtoname("2.5.29.15") -> "keyUsage"

"typepki-oiddb" Bulitin OID registration

There are two builtin OID data set:

  • OIDSET_CRYPTO - OIDs for common cryptographic algorithms and parameters
  • OIDSET_X509 - common OIDs for X.509 certificates, CRLs and extensions

OID data sets published

There is no data sets for now but they will be published near in the future.

Custom OID registration

import { OIDDataBase, OIDDataSet, OIDSET_CRYPTO, OIDSET_X509 } from "typepki-oiddb";
const oiddb = OIDDatabase.instance; // singleton object
oiddb.regist([OIDSET_CRYPTO, OIDSET_X509]);

When you want to add some OID name definitions, you can do it like this:

const MYOIDSET: OIDDataSet = {
  setname: "myoid",
  oidtoname: {
    "1.2.3.4.5.1": "my-oid-one",
    "1.2.3.4.5.2": "my-oid-two",
  },
};
oiddb.regist([MYOIDSET]);
oiddb.nametooid("my-oid-two") -> "1.2.3.4.5.2"
0.2.0

28 days ago

0.1.0

29 days ago