BRC-31 identity certificate.
A certificate binds a subject's public key to a set of encrypted fields, signed by a certifier. Fields are encrypted with per-field symmetric keys.
Binary format:
type (32 bytes) || serial (32 bytes) || subject (33 bytes) || certifier (33 bytes) || revocation_outpoint (36 bytes) || field_count (varint) || fields... || [sig_len (varint) || signature]
Summary
Functions
Deserialize a certificate from binary format.
Get the encryption protocol and key ID for a certificate field.
Sign the certificate using the certifier's wallet (ProtoWallet). Returns a new certificate with the signature set.
Serialize the certificate to binary format.
Verify the certificate signature.
Types
@type t() :: %BSV.Auth.Certificate{ cert_type: String.t(), certifier: BSV.PublicKey.t(), fields: %{required(String.t()) => String.t()}, revocation_outpoint: String.t(), serial_number: String.t(), signature: binary(), subject: BSV.PublicKey.t() }
Functions
Deserialize a certificate from binary format.
@spec get_encryption_details(String.t(), String.t()) :: {BSV.Wallet.Types.Protocol.t(), String.t()}
Get the encryption protocol and key ID for a certificate field.
@spec sign(t(), BSV.Wallet.ProtoWallet.t()) :: {:ok, t()} | {:error, String.t()}
Sign the certificate using the certifier's wallet (ProtoWallet). Returns a new certificate with the signature set.
Serialize the certificate to binary format.
Verify the certificate signature.