Registry / security / restpki-client

restpki-client

JSON →
library2.3.8jsnpmunverified

Node.js client library for consuming the REST PKI API from Lacuna Software. Version 2.3.8 is the latest stable release, maintained by Lacuna Software with regular updates. It provides classes to perform digital signature operations (PAdES, CAdES, XML signatures) and certificate authentication using REST PKI web service. Unlike low-level PKI libraries, it abstracts the complexity of cryptographic operations via cloud-based API. Supports TypeScript with bundled type definitions.

npm install restpki-client
INSTALL
IMPORT
SIG · RESTPKI-CLIENT
R
restpki-client
securityjavascriptv2.3.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RestPkiClient
import { RestPkiClient } from 'restpki-client'
const RestPkiClient = require('restpki-client')
Library is ESM-first; CommonJS require works with default export only, not named export.
PadesSignatureFinisher
import { PadesSignatureFinisher } from 'restpki-client'
const PadesSignatureFinisher = require('restpki-client').PadesSignatureFinisher
Named exports for specific finishers; CommonJS destructure is also valid.
Authentication
import { Authentication } from 'restpki-client'
import Authentication from 'restpki-client'
Authentication is a named export, not default.

Creates a REST PKI client and performs a PAdES signature on a PDF file.

import { RestPkiClient } from 'restpki-client'; import { PadesSignatureFinisher } from 'restpki-client'; const client = new RestPkiClient('https://pki.rest/', 'YOUR_API_TOKEN'); async function sign() { const signer = client.getPadesSigner(); signer.setSignerCertificateBase64('...'); signer.setFileToSign('path/to/document.pdf'); const finisher = new PadesSignatureFinisher(); const signedContent = await signer.sign(finisher); console.log('Signed PDF length:', signedContent.length); } sign().catch(console.error);
Debug
Known issues
breakingVersion 2.x requires TypeScript 4.x+ for type safety; older TS versions may fail.
fix
Upgrade TypeScript to 4.0 or later.
affects: >=2.0.0
deprecatedMethod `setPolicy()` on Signer classes is deprecated in favor of `setSignaturePolicy()`.
fix
Use `setSignaturePolicy(policy)` instead of `setPolicy(policy)`.
affects: <2.3.0
gotchaAPI token must be passed as second argument to RestPkiClient constructor; do not include 'Bearer ' prefix.
fix
Pass the exact token string obtained from Lacuna portal.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'restpki-client'
Package not installed or installed globally without --save.
fix
Run `npm install restpki-client --save` in your project root.
TypeError: RestPkiClient is not a constructor
Using default import with CommonJS require instead of named import.
fix
Use `const { RestPkiClient } = require('restpki-client')` or ESM import.
Error: Invalid API token
Token is missing, malformed, or expired.
fix
Verify token from Lacuna REST PKI console; ensure it's passed as a string without extra quotes.
Upgrade
Version history
2.3.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
restpki-client — npm install restpki-client · libregistry