API index
Every documented primitive, grouped by namespace page — 210 primitives. Generated from the same source comments that build the rest of this site.
Constants
| Primitive | Since | Status |
|---|---|---|
C.TIME.days(n) -> milliseconds | 0.1.0 | stable |
C.BYTES.mib(n) -> bytes | 0.1.0 | stable |
Errors
| Primitive | Since | Status |
|---|---|---|
new PkiError(message, code) | 0.1.0 | stable |
pki.errors.defineClass(name, opts?) -> constructor | 0.1.0 | stable |
ASN.1 / DER
| Primitive | Since | Status |
|---|---|---|
pki.asn1.decode(bytes, opts?) -> node | 0.1.0 | stable |
pki.asn1.read.oid(node) -> "1.2.840.113549.1.1.11" | 0.1.15 | stable |
pki.asn1.encode(classBits, constructed, tagNumber, content) -> Buffer | 0.1.0 | stable |
pki.asn1.build.sequence([ ...tlvBuffers ]) -> Buffer | 0.1.0 | stable |
CBOR (deterministic)
| Primitive | Since | Status |
|---|---|---|
pki.cbor.decode(bytes, opts?) -> node | 0.1.27 | stable |
pki.cbor.read.uint(node) -> 0n | 0.1.27 | stable |
pki.cbor.read.nint(node) -> -1n | 0.1.27 | stable |
pki.cbor.read.int(node) -> -1n | 0.1.27 | stable |
pki.cbor.read.byteString(node) -> Buffer | 0.1.27 | stable |
pki.cbor.read.textString(node) -> "text" | 0.1.27 | stable |
pki.cbor.read.array(node) -> [node, ...] | 0.1.27 | stable |
pki.cbor.read.map(node) -> [[keyNode, valueNode], ...] | 0.1.27 | stable |
pki.cbor.read.mapGet(node, key) -> valueNode | null | 0.2.20 | stable |
pki.cbor.read.boolean(node) -> false | 0.1.27 | stable |
pki.cbor.read.nullValue(node) -> null | 0.1.27 | stable |
pki.cbor.read.undefinedValue(node) -> undefined | 0.1.27 | stable |
pki.cbor.read.float(node) -> 1.5 | 0.1.27 | stable |
pki.cbor.read.biguint(node) -> 18446744073709551616n | 0.1.27 | stable |
pki.cbor.read.time(node) -> Date | 0.1.27 | stable |
pki.cbor.read.oid(node) -> "2.5.4.3" | 0.1.27 | stable |
Object Identifiers
| Primitive | Since | Status |
|---|---|---|
pki.oid.name(dotted) -> string | undefined | 0.1.0 | stable |
pki.oid.register(dotted, name) -> void | 0.1.0 | stable |
pki.oid.registerFamily(base, members) -> void | 0.1.2 | stable |
pki.oid.paramsMustBeAbsent(dotted) -> boolean | 0.1.21 | stable |
WebCrypto
| Primitive | Since | Status |
|---|---|---|
new pki.webcrypto.CryptoKey(type, extractable, algorithm, usages, handle) | 0.1.0 | stable |
await pki.webcrypto.subtle.exportKey(format, key) | 0.1.0 | stable |
pki.webcrypto.getRandomValues(typedArray) / pki.webcrypto.subtle | 0.1.0 | stable |
CMC
| Primitive | Since | Status |
|---|---|---|
pki.cmc.verify(response, sent?) -> Promise<verdict> | 0.4.16 | stable |
pki.cmc.build(spec, signer, opts?) -> Promise<Buffer|string> | 0.4.16 | stable |
Certification path validation (RFC 5280 6)
Trust-store ingestion
| Primitive | Since | Status |
|---|---|---|
pki.trust.parseCertdata(text) -> { anchors } | 0.2.0 | stable |
pki.trust.parseCcadbCsv(text) -> { anchors } | 0.2.0 | stable |
pki.trust.anchor(entry, opts?) -> trustAnchor | 0.2.0 | stable |
JOSE (JWS / JWK)
| Primitive | Since | Status |
|---|---|---|
pki.jose.base64url.encode(bytes) -> string | 0.1.25 | stable |
pki.jose.base64url.decode(text) -> Buffer | 0.1.25 | stable |
pki.jose.parseJson(input) -> value | 0.1.25 | stable |
pki.jose.assertPublicJwk(jwk) -> jwk | 0.1.25 | stable |
pki.jose.verify(jws, opts) -> Promise<{ header, payload, keySource }> | 0.1.25 | stable |
pki.jose.sign(opts) -> Promise<{ protected, payload, signature }> | 0.1.25 | stable |
pki.jose.thumbprint(jwk) -> Promise<string> | 0.1.25 | stable |
pki.jose.sigAlgs() -> Array<{alg,kty,crv,hash,saltLength}> | 0.5.3 | stable |
ACME
HPKE
Composite ML-KEM
| Primitive | Since | Status |
|---|---|---|
pki.kem.decapsulate(privateKey, ciphertext) -> Promise<Buffer> | 0.6.6 | stable |
pki.kem.encapsulate(publicKey) -> Promise<{ sharedSecret: Buffer, ciphertext: Buffer }> | 0.6.6 | stable |
Transport
| Primitive | Since | Status |
|---|---|---|
pki.transport.https(defaults?) -> transport | 0.3.16 | stable |
OCSP
Schema
| Primitive | Since | Status |
|---|---|---|
pki.schema.all() -> string[] | 0.1.7 | stable |
pki.schema.parse(input) -> parsed | 0.1.7 | stable |
pki.schema.detectFormat(input) -> string | null | 0.3.8 | stable |
Schema engine
| Primitive | Since | Status |
|---|---|---|
pki.schema.engine.walk(schema, node, ctx) -> value | 0.1.7 | stable |
pki.schema.engine.encode(schema, value, ctx) -> Buffer | 0.1.17 | stable |
pki.schema.engine.embeddedDer(schema, bytes, ctx, opts?) -> value | 0.1.18 | stable |
C509
| Primitive | Since | Status |
|---|---|---|
pki.schema.c509.parse(bytes) -> { certificateType, serialNumber, serialNumberHex, ... } | 0.2.30 | stable |
pki.schema.c509.encode(input[, opts]) -> Buffer | 0.3.4 | stable |
X.509
| Primitive | Since | Status |
|---|---|---|
pki.schema.x509.pemDecode(text, label?) -> Buffer | 0.1.7 | stable |
pki.schema.x509.pemEncode(der, label) -> string | 0.1.7 | stable |
pki.schema.x509.parse(input) -> certificate | 0.1.7 | stable |
PKCS#8
| Primitive | Since | Status |
|---|---|---|
pki.schema.pkcs8.parse(input) -> privateKey | 0.1.9 | stable |
pki.schema.pkcs8.parseEncrypted(input) -> encrypted | 0.1.9 | stable |
pki.schema.pkcs8.pemDecode(text, label?) -> Buffer | 0.1.9 | stable |
pki.schema.pkcs8.pemEncode(der, label?) -> string | 0.1.9 | stable |
TSP
| Primitive | Since | Status |
|---|---|---|
pki.schema.tsp.parseRequest(input) -> timeStampReq | 0.2.19 | stable |
pki.schema.tsp.parseTstInfo(input) -> tstInfo | 0.1.13 | stable |
pki.schema.tsp.parse(input) -> timeStampResp | 0.1.13 | stable |
pki.schema.tsp.parseToken(input) -> tstInfo | 0.1.13 | stable |
pki.schema.tsp.pemDecode(text, label?) -> Buffer | 0.1.13 | stable |
pki.schema.tsp.pemEncode(der, label) -> string | 0.1.23 | stable |
S/MIME (ESS)
| Primitive | Since | Status |
|---|---|---|
pki.schema.smime.parseSigningCertificate(der) -> { certs, policies } | 0.1.22 | stable |
pki.schema.smime.parseSigningCertificateV2(der) -> { certs, policies } | 0.1.22 | stable |
pki.schema.smime.parseSmimeCapabilities(der) -> { capabilities } | 0.1.22 | stable |
pki.schema.smime.decodeAttribute(attr) -> { kind, ... } | 0.1.22 | stable |
CSR Attributes
| Primitive | Since | Status |
|---|---|---|
pki.schema.csrattrs.parse(der) -> { items } | 0.1.24 | stable |
EST
SCEP
Stateful hash-based
| Primitive | Since | Status |
|---|---|---|
pki.shbs.verify(publicKey, message, signature) -> boolean | 0.2.1 | stable |
pki.shbs.verifyLms(publicKey, message, signature) -> boolean | 0.2.1 | stable |
Attribute certificates
Certificate management protocol messages
| Primitive | Since | Status |
|---|---|---|
pki.cmp.build(message, opts?) -> Promise<Buffer|string> | 0.3.5 | stable |
pki.cmp.transfer(url, message, opts?) -> Promise<{ response, responseBytes, status, contentType, tls }> | 0.3.19 | stable |
pki.cmp.wellKnownUrl(base, opts?) -> string | 0.3.19 | stable |
CRLs
Certificate request messages
Certification requests
Keys
PKCS#12
Sigstore
| Primitive | Since | Status |
|---|---|---|
pki.sigstore.pae(payloadType, payloadBytes) -> Buffer | 0.2.3 | stable |
pki.sigstore.parseBundle(input) -> bundle | 0.2.3 | stable |
pki.sigstore.verifyBundle(bundle, opts) -> Promise<result> | 0.2.3 | stable |
Inspect
| Primitive | Since | Status |
|---|---|---|
pki.inspect.certificate(input) -> string | 0.2.4 | stable |
pki.inspect.crl(input) -> string | 0.3.8 | stable |
pki.inspect.csr(input) -> string | 0.3.8 | stable |
pki.inspect.cms(input) -> string | 0.3.8 | stable |
pki.inspect.any(input) -> string | 0.3.8 | stable |
Lint
| Primitive | Since | Status |
|---|---|---|
pki.lint.certificate(input, opts?) -> LintReport | 0.2.10 | stable |
pki.lint.crl(pem | der | parsed, opts?) -> LintReport | 0.7.9 | stable |
pki.lint.ocsp(pem | der | parsed, opts?) -> LintReport | 0.7.26 | stable |
pki.lint.rules(profile?) -> [{id, severity, source, citation}] | 0.2.10 | stable |
pki.lint.profiles() -> [string] | 0.2.10 | stable |
CT
TLS
Merkle
| Primitive | Since | Status |
|---|---|---|
pki.merkle.leafHash(entry) -> Buffer | 0.1.28 | stable |
pki.merkle.nodeHash(left, right) -> Buffer | 0.1.28 | stable |
pki.merkle.emptyRootHash() -> Buffer | 0.1.28 | stable |
pki.merkle.verifyInclusion(opts) -> boolean | 0.1.28 | stable |
pki.merkle.verifyConsistency(opts) -> boolean | 0.1.28 | stable |