credential

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a thread-safe in-memory credential store

func NewStore

func NewStore() *Store

NewStore creates a new credential store

func (*Store) Add

func (s *Store) Add(cred *StoredCredential) string

Add stores a credential and returns its ID

func (*Store) Count

func (s *Store) Count() int

Count returns the number of stored credentials

func (*Store) Delete

func (s *Store) Delete(id string) bool

Delete removes a credential by ID

func (*Store) FindByFormat

func (s *Store) FindByFormat(format string) []*StoredCredential

FindByFormat returns credentials matching the given format

func (*Store) FindByVCT

func (s *Store) FindByVCT(vct string) []*StoredCredential

FindByVCT returns credentials matching the given VCT

func (*Store) Get

func (s *Store) Get(id string) (*StoredCredential, bool)

Get retrieves a credential by ID

func (*Store) List

func (s *Store) List() []*StoredCredential

List returns all stored credentials

type StoredCredential

type StoredCredential struct {
	// ID is a unique identifier for this stored credential
	ID string `json:"id"`
	// RawCredential is the raw credential string (SD-JWT, mdoc, etc.)
	RawCredential string `json:"raw_credential"`
	// Format is the credential format (e.g., "vc+sd-jwt", "mso_mdoc")
	Format string `json:"format"`
	// VCT is the verifiable credential type URN
	VCT string `json:"vct,omitempty"`
	// IssuerURL is the issuer that issued this credential
	IssuerURL string `json:"issuer_url"`
	// IssuedAt is when the credential was received
	IssuedAt time.Time `json:"issued_at"`
	// ScenarioName is the scenario that obtained this credential
	ScenarioName string `json:"scenario_name"`
	// NotificationID is the notification_id from the issuer (if any)
	NotificationID string `json:"notification_id,omitempty"`
	// TransactionID is the deferred transaction_id (if any)
	TransactionID string `json:"transaction_id,omitempty"`
}

StoredCredential represents a credential held in the wallet

Jump to

Keyboard shortcuts

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