holder

package
v5.4.40 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package holder is a generated GoMock package.

Package holder is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var VerifiableCredentialLDContextV1 = ssi.MustParseURI("https://www.w3.org/2018/credentials/v1")

VerifiableCredentialLDContextV1 holds the URI of the JSON-LD context for Verifiable Credentials.

View Source
var VerifiablePresentationLDType = ssi.MustParseURI("VerifiablePresentation")

VerifiablePresentationLDType holds the JSON-LD type for Verifiable Presentations.

Functions

This section is empty.

Types

type Holder

type Holder interface {
	// BuildVP builds and signs a Verifiable Presentation using the given Verifiable Credentials.
	// The assertion key used for signing it is taken from signerDID's DID document.
	// If signerDID is not provided, it will be derived from the credentials credentialSubject.id fields. But only if all provided credentials have the same (singular) credentialSubject.id field.
	BuildVP(ctx context.Context, credentials []vc.VerifiableCredential, options PresentationOptions, signerDID *did.DID, validateVC bool) (*vc.VerifiablePresentation, error)
}

Holder holds logic for Presenting credentials A Holder is a role an entity might perform by: * Possessing one or more verifiable credentials * Generating verifiable presentations from them Example holders include students, employees, and customers.

func New

func New(keyResolver vdr.KeyResolver, keyStore crypto.KeyStore, verifier verifier.Verifier, jsonldManager jsonld.JSONLD) Holder

New creates a new Holder.

type MockHolder

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

MockHolder is a mock of Holder interface.

func NewMockHolder

func NewMockHolder(ctrl *gomock.Controller) *MockHolder

NewMockHolder creates a new mock instance.

func (*MockHolder) BuildVP

func (m *MockHolder) BuildVP(ctx context.Context, credentials []vc.VerifiableCredential, options PresentationOptions, signerDID *did.DID, validateVC bool) (*vc.VerifiablePresentation, error)

BuildVP mocks base method.

func (*MockHolder) EXPECT

func (m *MockHolder) EXPECT() *MockHolderMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockHolderMockRecorder

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

MockHolderMockRecorder is the mock recorder for MockHolder.

func (*MockHolderMockRecorder) BuildVP

func (mr *MockHolderMockRecorder) BuildVP(ctx, credentials, options, signerDID, validateVC interface{}) *gomock.Call

BuildVP indicates an expected call of BuildVP.

type MockOpenIDHandler

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

MockOpenIDHandler is a mock of OpenIDHandler interface.

func NewMockOpenIDHandler

func NewMockOpenIDHandler(ctrl *gomock.Controller) *MockOpenIDHandler

NewMockOpenIDHandler creates a new mock instance.

func (*MockOpenIDHandler) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockOpenIDHandler) HandleCredentialOffer

func (m *MockOpenIDHandler) HandleCredentialOffer(ctx context.Context, offer openid4vci.CredentialOffer) error

HandleCredentialOffer mocks base method.

func (*MockOpenIDHandler) Metadata

Metadata mocks base method.

type MockOpenIDHandlerMockRecorder

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

MockOpenIDHandlerMockRecorder is the mock recorder for MockOpenIDHandler.

func (*MockOpenIDHandlerMockRecorder) HandleCredentialOffer

func (mr *MockOpenIDHandlerMockRecorder) HandleCredentialOffer(ctx, offer interface{}) *gomock.Call

HandleCredentialOffer indicates an expected call of HandleCredentialOffer.

func (*MockOpenIDHandlerMockRecorder) Metadata

func (mr *MockOpenIDHandlerMockRecorder) Metadata() *gomock.Call

Metadata indicates an expected call of Metadata.

type OpenIDHandler

type OpenIDHandler interface {
	// Metadata returns the OAuth2 client metadata for the wallet.
	Metadata() openid4vci.OAuth2ClientMetadata
	// HandleCredentialOffer handles a credential offer from an issuer.
	// It will try to retrieve the offered credential and store it.
	HandleCredentialOffer(ctx context.Context, offer openid4vci.CredentialOffer) error
}

OpenIDHandler is the interface for handling issuer operations using OpenID4VCI.

func NewOpenIDHandler

func NewOpenIDHandler(did did.DID, identifier string, httpClient core.HTTPRequestDoer, credentialStore vcrTypes.Writer, signer crypto.JWTSigner, resolver vdr.KeyResolver) OpenIDHandler

NewOpenIDHandler creates an OpenIDHandler that tries to retrieve offered credentials, to store it in the given credential store.

type PresentationOptions

type PresentationOptions struct {
	// AdditionalContexts contains the contexts to be added in addition to https://www.w3.org/2018/credentials/v1 and the context for JSONWebSignature2020
	AdditionalContexts []ssi.URI
	// AdditionalTypes contains the VerifiablePresentation types in addition to VerifiablePresentation
	AdditionalTypes []ssi.URI
	// ProofOptions contains the options for a specific proof.
	ProofOptions proof.ProofOptions
}

PresentationOptions contains parameters used to create the right VerifiablePresentation It's up to the caller to make sure the AdditionalTypes are covered by the AdditionalContexts

Jump to

Keyboard shortcuts

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