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

PrimitiveSinceStatus
C.TIME.days(n) -> milliseconds0.1.0stable
C.BYTES.mib(n) -> bytes0.1.0stable

Errors

PrimitiveSinceStatus
new PkiError(message, code)0.1.0stable
pki.errors.defineClass(name, opts?) -> constructor0.1.0stable

ASN.1 / DER

PrimitiveSinceStatus
pki.asn1.decode(bytes, opts?) -> node0.1.0stable
pki.asn1.read.oid(node) -> "1.2.840.113549.1.1.11"0.1.15stable
pki.asn1.encode(classBits, constructed, tagNumber, content) -> Buffer0.1.0stable
pki.asn1.build.sequence([ ...tlvBuffers ]) -> Buffer0.1.0stable

CBOR (deterministic)

PrimitiveSinceStatus
pki.cbor.decode(bytes, opts?) -> node0.1.27stable
pki.cbor.read.uint(node) -> 0n0.1.27stable
pki.cbor.read.nint(node) -> -1n0.1.27stable
pki.cbor.read.int(node) -> -1n0.1.27stable
pki.cbor.read.byteString(node) -> Buffer0.1.27stable
pki.cbor.read.textString(node) -> "text"0.1.27stable
pki.cbor.read.array(node) -> [node, ...]0.1.27stable
pki.cbor.read.map(node) -> [[keyNode, valueNode], ...]0.1.27stable
pki.cbor.read.mapGet(node, key) -> valueNode | null0.2.20stable
pki.cbor.read.boolean(node) -> false0.1.27stable
pki.cbor.read.nullValue(node) -> null0.1.27stable
pki.cbor.read.undefinedValue(node) -> undefined0.1.27stable
pki.cbor.read.float(node) -> 1.50.1.27stable
pki.cbor.read.biguint(node) -> 18446744073709551616n0.1.27stable
pki.cbor.read.time(node) -> Date0.1.27stable
pki.cbor.read.oid(node) -> "2.5.4.3"0.1.27stable

Object Identifiers

PrimitiveSinceStatus
pki.oid.name(dotted) -> string | undefined0.1.0stable
pki.oid.register(dotted, name) -> void0.1.0stable
pki.oid.registerFamily(base, members) -> void0.1.2stable
pki.oid.paramsMustBeAbsent(dotted) -> boolean0.1.21stable

WebCrypto

PrimitiveSinceStatus
new pki.webcrypto.CryptoKey(type, extractable, algorithm, usages, handle)0.1.0stable
await pki.webcrypto.subtle.exportKey(format, key)0.1.0stable
pki.webcrypto.getRandomValues(typedArray) / pki.webcrypto.subtle0.1.0stable

CMC

PrimitiveSinceStatus
pki.cmc.verify(response, sent?) -> Promise<verdict>0.4.16stable
pki.cmc.build(spec, signer, opts?) -> Promise<Buffer|string>0.4.16stable

Certification path validation (RFC 5280 6)

PrimitiveSinceStatus
pki.path.validate(path, opts) -> Promise<result>0.1.16stable
pki.path.crlChecker(crls, opts?) -> RevocationChecker0.1.16stable
pki.path.ocspChecker(responses) -> RevocationChecker0.1.32stable
pki.path.verifyOcspResponse(response, cert, issuerCert, time, opts?) -> Promise<{ valid, status, responderAuthorized, signatureValid, matched, thisUpdate, nextUpdate, revocationReason?, revocationTime?, reason }>0.2.22stable
pki.path.anchorFromCert(cert) -> { name, publicKey, algorithm, parameters, subjectDer }stable
pki.path.build(leaf, opts) -> Promise<{ valid, path, trustAnchor, result, candidatesConsidered, aiaFetches }>0.3.7stable

Trust-store ingestion

PrimitiveSinceStatus
pki.trust.parseCertdata(text) -> { anchors }0.2.0stable
pki.trust.parseCcadbCsv(text) -> { anchors }0.2.0stable
pki.trust.anchor(entry, opts?) -> trustAnchor0.2.0stable

JOSE (JWS / JWK)

PrimitiveSinceStatus
pki.jose.base64url.encode(bytes) -> string0.1.25stable
pki.jose.base64url.decode(text) -> Buffer0.1.25stable
pki.jose.parseJson(input) -> value0.1.25stable
pki.jose.assertPublicJwk(jwk) -> jwk0.1.25stable
pki.jose.verify(jws, opts) -> Promise<{ header, payload, keySource }>0.1.25stable
pki.jose.sign(opts) -> Promise<{ protected, payload, signature }>0.1.25stable
pki.jose.thumbprint(jwk) -> Promise<string>0.1.25stable
pki.jose.sigAlgs() -> Array<{alg,kty,crv,hash,saltLength}>0.5.3stable

ACME

PrimitiveSinceStatus
pki.acme.assertTransition(kind, from, to) -> void0.1.25stable
pki.acme.validateProblem(obj) -> obj0.1.25stable
pki.acme.validate(kind, obj) -> obj0.1.25stable
pki.acme.identify(obj) -> string0.1.25stable
pki.acme.keyAuthorization(token, accountJwk) -> Promise<string>0.1.25stable
pki.acme.http01(token, accountJwk) -> Promise<{ path, body }>0.1.25stable
pki.acme.dns01(token, accountJwk, domain) -> Promise<{ name, value }>0.1.25stable
pki.acme.tlsAlpn01Extension(token, accountJwk) -> Promise<Buffer>0.1.25stable
pki.acme.verifyTlsAlpn01(certDer, token, accountJwk, identifier) -> Promise<void>0.1.25stable
pki.acme.postAsGet(opts) -> Promise<object>0.1.25stable
pki.acme.newAccount(opts) -> Promise<object>0.1.25stable
pki.acme.externalAccountBinding(opts) -> Promise<object>0.1.25stable
pki.acme.newOrder(opts) -> Promise<object>0.1.25stable
pki.acme.newAuthz(opts) -> flattened JWS0.3.29stable
pki.acme.finalize(opts) -> Promise<object>0.1.25stable
pki.acme.challengeResponse(opts) -> Promise<object>0.1.25stable
pki.acme.deactivate(opts) -> Promise<object>0.1.25stable
pki.acme.updateAccount(opts) -> Promise<object>0.6.4stable
pki.acme.revokeCert(opts) -> Promise<object>0.1.25stable
pki.acme.keyChange(opts) -> Promise<object>0.1.25stable
pki.acme.ariCertId(certDer) -> string0.1.25stable
pki.acme.parseAriCertId(certId) -> { keyIdentifier, serial }0.1.25stable
pki.acme.validateRenewalInfo(obj) -> obj0.1.25stable
pki.acme.client(directoryUrl, opts) -> client0.3.18stable

HPKE

PrimitiveSinceStatus
pki.hpke.setupS(suiteIds, recipientPublicKey, opts?) -> { enc, context, sharedSecret }0.2.2stable
pki.hpke.setupR(suiteIds, enc, recipientPrivateKey, opts?) -> context0.2.2stable
pki.hpke.seal(suiteIds, recipientPublicKey, opts, aad, pt) -> { enc, ct }0.2.2stable
pki.hpke.open(suiteIds, enc, recipientPrivateKey, opts, aad, ct) -> pt0.2.2stable

Composite ML-KEM

PrimitiveSinceStatus
pki.kem.decapsulate(privateKey, ciphertext) -> Promise<Buffer>0.6.6stable
pki.kem.encapsulate(publicKey) -> Promise<{ sharedSecret: Buffer, ciphertext: Buffer }>0.6.6stable

Transport

PrimitiveSinceStatus
pki.transport.https(defaults?) -> transport0.3.16stable

OCSP

PrimitiveSinceStatus
pki.ocsp.buildRequest(query, opts?) -> Buffer | string0.2.22stable
pki.ocsp.sign(responseData, responder, opts?) -> Promise<Buffer | string>0.2.22stable
pki.ocsp.buildErrorResponse(status) -> Buffer0.2.22stable
pki.ocsp.verify(response, opts) -> Promise<{ valid, status, responderAuthorized, signatureValid, matched, thisUpdate, nextUpdate, revocationReason?, revocationTime?, nonceMatched?, reason }>0.2.22stable
pki.ocsp.verifyRequest(request, opts?) -> Promise<{ valid, signed, signatureValid, requestorNamed, signerCert, signerCerts, certs, signerSubject, requestorName, requestList, requestExtensions, version, reason }>0.6.0stable

Schema

PrimitiveSinceStatus
pki.schema.all() -> string[]0.1.7stable
pki.schema.parse(input) -> parsed0.1.7stable
pki.schema.detectFormat(input) -> string | null0.3.8stable

Schema engine

PrimitiveSinceStatus
pki.schema.engine.walk(schema, node, ctx) -> value0.1.7stable
pki.schema.engine.encode(schema, value, ctx) -> Buffer0.1.17stable
pki.schema.engine.embeddedDer(schema, bytes, ctx, opts?) -> value0.1.18stable

C509

PrimitiveSinceStatus
pki.schema.c509.parse(bytes) -> { certificateType, serialNumber, serialNumberHex, ... }0.2.30stable
pki.schema.c509.encode(input[, opts]) -> Buffer0.3.4stable

X.509

PrimitiveSinceStatus
pki.schema.x509.pemDecode(text, label?) -> Buffer0.1.7stable
pki.schema.x509.pemEncode(der, label) -> string0.1.7stable
pki.schema.x509.parse(input) -> certificate0.1.7stable

PKCS#8

PrimitiveSinceStatus
pki.schema.pkcs8.parse(input) -> privateKey0.1.9stable
pki.schema.pkcs8.parseEncrypted(input) -> encrypted0.1.9stable
pki.schema.pkcs8.pemDecode(text, label?) -> Buffer0.1.9stable
pki.schema.pkcs8.pemEncode(der, label?) -> string0.1.9stable

TSP

PrimitiveSinceStatus
pki.schema.tsp.parseRequest(input) -> timeStampReq0.2.19stable
pki.schema.tsp.parseTstInfo(input) -> tstInfo0.1.13stable
pki.schema.tsp.parse(input) -> timeStampResp0.1.13stable
pki.schema.tsp.parseToken(input) -> tstInfo0.1.13stable
pki.schema.tsp.pemDecode(text, label?) -> Buffer0.1.13stable
pki.schema.tsp.pemEncode(der, label) -> string0.1.23stable

S/MIME (ESS)

PrimitiveSinceStatus
pki.schema.smime.parseSigningCertificate(der) -> { certs, policies }0.1.22stable
pki.schema.smime.parseSigningCertificateV2(der) -> { certs, policies }0.1.22stable
pki.schema.smime.parseSmimeCapabilities(der) -> { capabilities }0.1.22stable
pki.schema.smime.decodeAttribute(attr) -> { kind, ... }0.1.22stable

CSR Attributes

PrimitiveSinceStatus
pki.schema.csrattrs.parse(der) -> { items }0.1.24stable

EST

PrimitiveSinceStatus
pki.est.transferDecode(body) -> Buffer0.1.24stable
pki.est.transferEncode(der) -> string0.1.24stable
pki.est.parseCertsOnly(der) -> { certificates, crls }0.1.24stable
pki.est.classifyResponse(status, headers, body, opts?) -> verdict0.1.24stable
pki.est.paths(baseUrl, opts?) -> { cacerts, simpleenroll, ... }0.1.24stable
pki.est.challengePasswordFromTlsUnique(channelBinding) -> Buffer0.6.31stable
pki.est.fullcmc(baseUrl, request, opts?) -> Promise<verdict | { retry, retryAfterSeconds }>0.4.16stable
pki.est.cacerts(baseUrl, opts?) -> Promise<{ certificates, crls } | { retry, retryAfterSeconds }>0.3.16stable
pki.est.simpleenroll(baseUrl, csr | builder, opts?) -> Promise<{ certificate, chain, certificates } | { retry, retryAfterSeconds }>0.3.16stable
pki.est.simplereenroll(baseUrl, csr | builder, opts?) -> Promise<{ certificate, chain, certificates } | { retry, retryAfterSeconds }>0.3.16stable
pki.est.serverkeygen(baseUrl, csr, opts?) -> Promise<{ certificates, privateKey } | { certificates, encryptedKey } | { retry, retryAfterSeconds, retryAfterDate }>0.3.28stable
pki.est.csrattrs(baseUrl, opts?) -> Promise<{ available: true, attrs, plan } | { available: false, attrs: null }>0.3.28stable

SCEP

PrimitiveSinceStatus
pki.scep.build(spec) -> Promise<Buffer>0.6.2stable
pki.scep.parse(bytes, opts?) -> Promise<verdict>0.6.2stable
pki.scep.parseCapabilities(text) -> { AES?, "SHA-256"?, POSTPKIOperation?, ... }0.6.7stable
pki.scep.getCACaps(baseUrl, opts?) -> Promise<capabilities>0.6.7stable
pki.scep.getCACert(baseUrl, opts?) -> Promise<{ caCertificate, certificates }>0.6.7stable
pki.scep.getNextCACert(baseUrl, opts) -> Promise<{ certificates }>0.6.14stable
pki.scep.enroll(baseUrl, opts) -> Promise<{ status, certificate?, certificates?, transactionId }>0.6.7stable
pki.scep.renew(baseUrl, opts) -> Promise<{ status, certificate?, certificates?, transactionId }>0.6.7stable
pki.scep.getCert(baseUrl, opts) -> Promise<{ certificate, certificates, transactionId }>0.6.17stable
pki.scep.getCrl(baseUrl, opts) -> Promise<{ crl, crls, transactionId }>0.6.17stable

Stateful hash-based

PrimitiveSinceStatus
pki.shbs.verify(publicKey, message, signature) -> boolean0.2.1stable
pki.shbs.verifyLms(publicKey, message, signature) -> boolean0.2.1stable

Attribute certificates

PrimitiveSinceStatus
pki.attrcert.sign(spec, issuer, opts?) -> Promise<Buffer|string>0.3.2stable
pki.attrcert.verify(ac, issuer, opts) -> Promise<{ valid, verified, signatureValid, validityChecked, targetingChecked, revocationChecked, noRevAvail, holderBindingChecked, issuerPathChecked, holder, issuer, attributes, extensions, notBefore, notAfter, serialNumberHex, reason }>0.5.15stable

Certificate management protocol messages

PrimitiveSinceStatus
pki.cmp.build(message, opts?) -> Promise<Buffer|string>0.3.5stable
pki.cmp.transfer(url, message, opts?) -> Promise<{ response, responseBytes, status, contentType, tls }>0.3.19stable
pki.cmp.wellKnownUrl(base, opts?) -> string0.3.19stable

CRLs

PrimitiveSinceStatus
pki.crl.sign(spec, issuer, opts?) -> Promise<Buffer|string>0.3.9stable
pki.crl.verify(crl, issuer) -> Promise<{ valid, issuerMaySign, signatureValid, issuer, code?, reason? }>0.3.9stable
pki.crl.isRevoked(crl, serialNumber, opts?) -> entry | null0.3.9stable

Certificate request messages

PrimitiveSinceStatus
pki.crmf.build(spec, key?, opts?) -> Promise<Buffer|string>0.3.3stable
pki.crmf.buildCertTemplate(template) -> Buffer0.3.5stable
pki.crmf.verifyPop(messages) -> Promise<{ valid, verified, messages: [{ valid, verified, method, cryptographicallyVerified, certReqId, subject, subjectBound, publicKey, reason }] }>0.5.14stable

Certification requests

PrimitiveSinceStatus
pki.csr.sign(spec, key, opts?) -> Promise<Buffer|string>0.3.1stable
pki.csr.verify(request) -> Promise<{ valid, verified, subject, subjectPublicKeyInfo, attributes, certificationRequestInfoBytes }>0.5.13stable

Keys

PrimitiveSinceStatus
pki.key.encrypt(privateKey, password, opts?) -> Promise<Buffer|string>0.3.10stable
pki.key.decrypt(encrypted, password, opts?) -> Promise<Buffer|string>0.3.10stable
pki.key.export(key, opts?) -> Promise<Buffer|string>0.3.10stable
pki.key.import(input, opts?) -> Promise<CryptoKey>0.3.10stable
pki.key.generate(algorithm, opts?) -> Promise<{ privateKey, publicKey }>0.3.10stable
pki.key.publicFromPrivate(privateKey, opts?) -> Promise<Buffer|string>0.3.10stable

PKCS#12

PrimitiveSinceStatus
pki.pkcs12.build(spec, opts?) -> Promise<Buffer|string>0.3.11stable
pki.pkcs12.verifyMac(pfx, password, opts?) -> Promise<{ valid, macAlgorithm, macAlgorithmName, iterationCount }>0.3.11stable
pki.pkcs12.open(pfx, password, opts?) -> Promise<OpenResult>0.3.12stable

Sigstore

PrimitiveSinceStatus
pki.sigstore.pae(payloadType, payloadBytes) -> Buffer0.2.3stable
pki.sigstore.parseBundle(input) -> bundle0.2.3stable
pki.sigstore.verifyBundle(bundle, opts) -> Promise<result>0.2.3stable

Inspect

PrimitiveSinceStatus
pki.inspect.certificate(input) -> string0.2.4stable
pki.inspect.crl(input) -> string0.3.8stable
pki.inspect.csr(input) -> string0.3.8stable
pki.inspect.cms(input) -> string0.3.8stable
pki.inspect.any(input) -> string0.3.8stable

Lint

PrimitiveSinceStatus
pki.lint.certificate(input, opts?) -> LintReport0.2.10stable
pki.lint.crl(pem | der | parsed, opts?) -> LintReport0.7.9stable
pki.lint.ocsp(pem | der | parsed, opts?) -> LintReport0.7.26stable
pki.lint.rules(profile?) -> [{id, severity, source, citation}]0.2.10stable
pki.lint.profiles() -> [string]0.2.10stable

CT

PrimitiveSinceStatus
pki.ct.parseSctList(extValue) -> { scts, unknownScts, all }0.1.20stable
pki.ct.reconstructSignedData(entry, sct) -> Buffer0.1.20stable
pki.ct.verifySct(entry, sct, logPublicKey) -> Promise<boolean>0.2.12stable
pki.ct.encodeSctList(scts) -> Buffer0.2.24stable
pki.ct.signSct(entry, logKey, opts?) -> Promise<sct>0.2.24stable
pki.ct.parseLogList(json, opts?) -> { logs, byLogId, version, timestamp }0.2.28stable
pki.ct.verifySctWithLogList(entry, sct, logList, opts?) -> Promise<{ valid, logId, logIdHex, operator, logState, timestamp }>0.2.28stable
pki.ct.verifySctList(entry, list, logList, opts?) -> Promise<verdict>0.6.1stable
pki.ct.x509CertEntry(cert, issuer) -> { entryType, tbsCertificate, issuerKeyHash }0.6.1stable
pki.ct.verifyLogListSignature(json, signature, publicKey) -> Promise<boolean>0.2.29stable
pki.ct.fetchLogList(opts) -> Promise<{ logs, byLogId, version, timestamp, raw, status, contentType, tls }>0.3.21stable

TLS

PrimitiveSinceStatus
pki.tls.decompressCertificate(bytes, opts?) -> { algorithm, algorithmName, uncompressedLength, certificateMessage, certificate }0.4.3stable
pki.tls.parseCertificateMessage(bytes, opts?) -> { certificateRequestContext, entries }0.4.3stable
pki.tls.compressCertificate(certificateMessage, opts?) -> Buffer0.4.3stable

Merkle

PrimitiveSinceStatus
pki.merkle.leafHash(entry) -> Buffer0.1.28stable
pki.merkle.nodeHash(left, right) -> Buffer0.1.28stable
pki.merkle.emptyRootHash() -> Buffer0.1.28stable
pki.merkle.verifyInclusion(opts) -> boolean0.1.28stable
pki.merkle.verifyConsistency(opts) -> boolean0.1.28stable

WebAuthn

PrimitiveSinceStatus
pki.webauthn.parseCoseKey(bytes) -> object0.5.2stable
pki.webauthn.parseAttestationObject(bytes) -> { fmt, attStmt, authData, authDataBytes }0.2.5stable
pki.webauthn.verify(attestationObject, clientDataHash?, opts?) -> Promise<{ valid, attestationVerified, fmt, attestationType, trustPath, anchoredTo, aaguid, credentialId, credentialPublicKey, credentialPublicKeyBytes, signCount, flags, rpIdHash, extensions, bindingChecked, clientData }>0.2.5stable
pki.webauthn.verifyMetadataBlob(blob, opts) -> Promise<{ no, legalHeader, nextUpdate, stale, allowStale, rollbackChecked, previousNo, entries, byAaguid, byKeyIdentifier, statusPolicy, rejectUnknownStatus }>0.4.11stable
pki.webauthn.metadataFor(metadata, identifier) -> entry | null0.4.11stable
pki.webauthn.metadataAnchors(entry, opts?) -> [certificate]0.4.11stable
pki.webauthn.parseClientData(bytes, opts?) -> { type, challenge, origin, crossOrigin, topOrigin, checked }0.5.0stable
pki.webauthn.parseAuthenticatorData(bytes) -> { rpIdHash, flags, signCount, aaguid, credentialId, credentialPublicKey, credentialPublicKeyBytes, extensions }0.5.0stable
pki.webauthn.verifyAssertion(input) -> Promise<{ valid, signatureVerified, signCount, signCountChecked, flags, rpIdHash, extensions, bindingChecked, clientData }>0.5.0stable

CMS

PrimitiveSinceStatus
pki.cms.verify(input, opts?) -> Promise<{ valid, trusted, eContentType, eContent, signers }>0.2.14stable
pki.cms.sign(content, signers, opts?) -> Promise<Buffer|string>0.2.15stable
pki.cms.countersign(cms, signers, opts?) -> Promise<Buffer|string>0.3.13stable
pki.cms.encrypt(content, recipients, opts?) -> Promise<Buffer | string>0.2.23stable
pki.cms.authenticate(content, recipients, opts?) -> Promise<Buffer | string>0.3.14stable
pki.cms.decrypt(input, keyMaterial, opts?) -> Promise<{ content, contentType, contentTypeName, recipientType, recipientIndex, contentEncryptionAlgorithm, authenticated, authenticatedBy, originAuthenticated, originatorInfo }>0.2.23stable
pki.cms.compress(content, opts?) -> Promise<Buffer | string>0.2.27stable
pki.cms.decompress(input, opts?) -> Promise<{ content, contentType, contentTypeName, compressionAlgorithm }>0.2.27stable
pki.cms.certsOnly(certs, opts?) -> Buffer | string0.6.3stable
pki.cms.parseCertsOnly(input, opts?) -> { certificates, crls }0.6.3stable
pki.cms.isCertsOnly(input) -> boolean0.6.3stable