BSV.Auth.VerifiableCertificate (bsv_sdk v1.5.1)

Copy Markdown View Source

A certificate with a verifier-specific keyring for selective field decryption.

Summary

Functions

Decrypt the fields using the verifier wallet and the keyring. Returns the decrypted fields map and an updated struct.

Create a new VerifiableCertificate.

Verify the certificate signature (delegates to Certificate.verify).

Types

t()

@type t() :: %BSV.Auth.VerifiableCertificate{
  certificate: BSV.Auth.Certificate.t(),
  decrypted_fields: %{required(String.t()) => String.t()},
  keyring: %{required(String.t()) => String.t()}
}

Functions

decrypt_fields(vc, wallet)

@spec decrypt_fields(t(), BSV.Wallet.ProtoWallet.t()) ::
  {:ok, %{required(String.t()) => String.t()}, t()} | {:error, String.t()}

Decrypt the fields using the verifier wallet and the keyring. Returns the decrypted fields map and an updated struct.

new(cert, keyring)

@spec new(BSV.Auth.Certificate.t(), %{required(String.t()) => String.t()}) :: t()

Create a new VerifiableCertificate.

verify(verifiable_certificate)

@spec verify(t()) :: {:ok, boolean()} | {:error, String.t()}

Verify the certificate signature (delegates to Certificate.verify).