presentation

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePresentation

func CreatePresentation(
	holderDID string,
	holderPrivateKey ed25519.PrivateKey,
	credentials []string,
	audience string,
	nonce string,
) (string, error)

CreatePresentation creates a signed Verifiable Presentation

func GenerateNonce

func GenerateNonce() (string, error)

GenerateNonce creates a random nonce for challenge-response

Types

type VPClaims

type VPClaims struct {
	Issuer    string                 `json:"iss"`
	Subject   string                 `json:"sub"`
	Audience  string                 `json:"aud"`
	Nonce     string                 `json:"nonce"`
	IssuedAt  time.Time              `json:"iat"`
	ExpiresAt time.Time              `json:"exp"`
	VP        VerifiablePresentation `json:"vp"`
}

VPClaims represents the PASETO claims for a Verifiable Presentation

func VerifyPresentation

func VerifyPresentation(
	tokenString string,
	holderPublicKey ed25519.PublicKey,
	expectedAudience string,
	expectedNonce string,
) (*VPClaims, error)

VerifyPresentation verifies a PASETO VP token and returns the claims

type VerifiablePresentation

type VerifiablePresentation struct {
	Context              []string `json:"@context"`
	Type                 []string `json:"type"`
	ID                   string   `json:"id,omitempty"`
	Holder               string   `json:"holder"`
	VerifiableCredential []string `json:"verifiableCredential"`
}

VerifiablePresentation represents a VP containing one or more VCs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL