get UUID value of this object. This is debugging purpose.
Static
instanceget instance of OIDDataBase
const oiddb = OIDDataBase.instance;
convert alias name to original OID name defined in internal database
alias name (ex. "P-256").
original OID name (ex. "prime256v1"). Return undefined if not defined.
oiddb.aliasto("P-256") -> "prime256v1"
oiddb.aliasto("FOO") -> undefined // FOO is not defined in aliases
convert OID name to OID value defined in internal database
OID name. (ex. "countryName").
OID value (ex. "1.2.3.4"). Return undefined if not defined.
oiddb.nametooid("keyUsage") -> "2.5.29.15"
oiddb.nametooid("foo-bar-") -> undefined // not registered
oiddb.nametooid("P-521") -> "1.3.132.0.35"
convert OID name to short attribute type name defined in internal database
OID name (ex. "commonName").
Optional
useUndef: booleanflag to return undefined when it is undefined in the database
short attribute type name for distinguished name. (ex. "CN"). Return OID name if not defined.
oiddb.nametoshort("commonName") -> "CN"
oiddb.nametoshort("serialNumber") -> "serialNumber" // for undefined short name
oiddb.nametoshort("serialNumber", true) -> undefined // for undefined short name
convert OID value to OID name defined in internal database
OID value (ex. "1.2.3.4")
Optional
useUndef: booleanflag to return undefined when it is undefined in the database
OID name. (ex. "countryName"). Return undefined if not defined.
oiddb.oidtoname("2.5.29.15") -> "keyUsage"
oiddb.oidtoname("1.2.3.4") -> "1.2.3.4"
oiddb.oidtoname("1.2.3.4", true) -> undefined
convert OID value to short attribute type name defined in internal database
OID value (ex. "2.5.4.6").
Optional
useUndef: booleanflag to return undefined when it is undefined in the database
short attribute type name for distinguished name. (ex. "C"). Return OID name if not defined.
oiddb.oidtoshort("2.5.4.6") -> "CN"
oiddb.oidtoshort("2.5.4.97") -> "organizationIdentifier" // OID defined but short name not defined
oiddb.oidtoshort("1.2.3.4") -> "1.2.3.4" // for undefined short name nor OID name
oiddb.oidtoshort("1.2.3.4", true) -> undefined
Register OID data set to a singleton object
array of OIDDataSet
This method will add OID definitions to object internal database by the list of OIDDataSet. When the OIDDataSet.setname already registered, its importing will be skipped. Also when the registering OID is already registered, its OID registration is skipped. This means existing OID definition will not be overwritten.
import { OIDDataBase, OIDSET_CRYPTO, OIDSET_X509 } from "typepki-oiddb";
const oiddb = OIDDatabase.instance;
oiddb.regist([OIDSET_CRYPTO, OIDSET_X509]);
convert short attribute type name to OID value defined in internal database
short attribute type name for distinguished name. (ex. "CN").
Optional
useUndef: booleanflag to return undefined when it is undefined in the database
OID name (ex. "commonName"). Return undefined if not defined.
oiddb.shorttoname("CN") -> "commonName"
oiddb.shorttoname("FOO") -> undefined // not registered
oiddb.shorttoname("FOO", true) -> "FOO" // not registered
Singleton class for OID(object identifier) name database
Example