PaperForge.Signature.Provider behaviour (PaperForge v1.4.0)

Copy Markdown View Source

Contract for pluggable PDF signature providers.

Providers isolate certificate storage and signing infrastructure from the stable PaperForge API. The built-in provider uses Elixir/OTP software keys; applications may replace it with an HSM, KMS, or another signing service.

Summary

Types

capability()

@type capability() :: :invisible | :visible | :incremental | :multiple | :timestamp

result()

@type result() :: {:ok, binary()} | {:error, term()}

Callbacks

capabilities()

@callback capabilities() :: [capability()]

sign(binary, keyword)

@callback sign(
  binary(),
  keyword()
) :: result()

verify(binary, keyword)

@callback verify(
  binary(),
  keyword()
) :: {:ok, term()} | {:error, term()}