SignatureKit

Introduction

Effect-native signing for TypeScript — A1 first, one Signatures boundary, XML/PDF formats around it, and browser UI at the app edge.

SignatureKit is a library from licitei-oss, the open-source initiative maintained by Licitei. The source code lives at Licitei/signature-kit and is licensed under MIT.

SignatureKit has one signing boundary: the Signatures Effect service. Start with an A1 / PKCS#12 certificate, then reuse the same boundary from Node, the browser, XML-DSig, and PDF/PAdES. Remote providers stay separate provider APIs; browser UI stays at the application edge.

Choose the path

One boundary

flowchart TD
  app["Application / browser UI"]
  service["Signatures service<br/>inspect / sign / verify"]
  adapter["SignerAdapter layer"]
  a1["A1 / PKCS#12<br/>Node or browser"]
  formats["XML-DSig + PDF/PAdES<br/>document mutation"]
  providers["Provider APIs<br/>remote request flows"]

  app --> service
  service --> adapter
  adapter --> a1
  service --> formats
  app --> providers

title="signature-kit.ts"

import { a1SignaturesLayer } from "@signature-kit/a1/signer"
import { signatures } from "@signature-kit/signatures"
import { Effect, Redacted } from "effect"

export const signWithA1 = (content: Uint8Array, pfx: Uint8Array, password: string) =>
  Effect.gen(function* () {
    const identity = yield* signatures.inspect()
    const artifact = yield* signatures.sign({ content, algorithm: "rsa-sha256" })

    return { identity, artifact }
  }).pipe(
    Effect.provide(
      a1SignaturesLayer({
        pfx,
        password: Redacted.make(password),
      }),
    ),
  )

The program knows the contract, not the key location. Browser A1, server A1, XML, and PDF/PAdES all provide or consume the same service.

Product rules

  • A1 first. The first local signer is PKCS#12 (.pfx / .p12) with passwords kept in Redacted.

  • Browser PDF is format-owned. @signature-kit/pdf owns file bytes, placement state, and browser A1 PDF signing; app UI only subscribes to that state and provides a1SignaturesLayer at the action boundary.

  • Formats mutate documents. XML-DSig and PDF/PAdES own document mutation around signatures.sign; signer adapters only own signing power.

  • Remote APIs stay explicit. Clicksign, Assinafy, ZapSign, DocuSeal, and Documenso keep provider-specific APIs instead of pretending to be one universal signer.

  • Failures are values. Recoverable faults are typed SignatureKitError or package-specific Effect errors, not thrown exceptions.

Go deeper

@signature-kit/signatures @signature-kit/a1

How is this guide?