Layr8.Presentations (layr8 v0.2.6)

Copy Markdown View Source

W3C Verifiable Presentation operations via the Layr8 cloud-node REST API.

All functions accept a Layr8.REST client and keyword options.

Example

rest = Layr8.REST.new("https://node.example.com", "my-api-key")
{:ok, vp_jwt} = Layr8.Presentations.sign_presentation(rest, [vc_jwt], holder_did: "did:example:alice")

Summary

Functions

Signs a W3C Verifiable Presentation wrapping one or more signed credential JWTs.

Verifies a signed presentation using the verifier DID's authentication key.

Functions

sign_presentation(rest, credentials, opts \\ [])

@spec sign_presentation(Layr8.REST.t(), [String.t()], keyword()) ::
  {:ok, String.t()} | {:error, term()}

Signs a W3C Verifiable Presentation wrapping one or more signed credential JWTs.

Uses the holder's authentication key (not assertion key).

Options

  • :holder_did — holder DID (default: agent DID)
  • :format — output format: "compact_jwt" (default), "json", "jwt", "enveloped"
  • :nonce — optional nonce/challenge for the presentation

Returns {:ok, signed_jwt} or {:error, reason}.

verify_presentation(rest, signed_presentation, opts \\ [])

@spec verify_presentation(Layr8.REST.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, term()}

Verifies a signed presentation using the verifier DID's authentication key.

Options

  • :verifier_did — verifier DID (default: agent DID)

Returns {:ok, verified} or {:error, reason}.