Documentation ¶
Overview ¶
Package openid4vp contains functionality for doing OpenID4VP operations.
Index ¶
- type Acknowledgment
- type Args
- type CredentialClaimKeys
- type Interaction
- func (o *Interaction) Acknowledgment() *Acknowledgment
- func (o *Interaction) CustomScope() *Scope
- func (o *Interaction) GetQuery() ([]byte, error)
- func (o *Interaction) OTelTraceID() string
- func (o *Interaction) PresentCredential(credentials *verifiable.CredentialsArray) error
- func (o *Interaction) PresentCredentialOpts(credentials *verifiable.CredentialsArray, opts *PresentCredentialOpts) error
- func (o *Interaction) PresentCredentialUnsafe(credential *verifiable.Credential) error
- func (o *Interaction) PresentedClaims(credential *verifiable.Credential) (*CredentialClaimKeys, error)
- func (o *Interaction) TrustInfo() (*VerifierTrustInfo, error)
- func (o *Interaction) VerifierDisplayData() *VerifierDisplayData
- type Opts
- func (o *Opts) AddHeader(header *api.Header) *Opts
- func (o *Opts) AddHeaders(headers *api.Headers) *Opts
- func (o *Opts) DisableHTTPClientTLSVerify() *Opts
- func (o *Opts) DisableOpenTelemetry() *Opts
- func (o *Opts) EnableAddingDIProofs(kms *localkms.KMS) *Opts
- func (o *Opts) SetActivityLogger(activityLogger api.ActivityLogger) *Opts
- func (o *Opts) SetDocumentLoader(documentLoader api.LDDocumentLoader) *Opts
- func (o *Opts) SetHTTPTimeoutNanoseconds(timeout int64) *Opts
- func (o *Opts) SetMetricsLogger(metricsLogger api.MetricsLogger) *Opts
- type PresentCredentialOpts
- func (o *PresentCredentialOpts) AddScopeClaim(claimName, claimJSON string) *PresentCredentialOpts
- func (o *PresentCredentialOpts) SetAttestationVC(vm *api.VerificationMethod, vc string) *PresentCredentialOpts
- func (o *PresentCredentialOpts) SetInteractionDetails(serializedInteractionDetails string) *PresentCredentialOpts
- type Scope
- type VerifierDisplayData
- type VerifierTrustInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acknowledgment ¶
type Acknowledgment struct {
// contains filtered or unexported fields
}
Acknowledgment represents an object that allows to acknowledge the verifier on presentation request status.
func NewAcknowledgment ¶
func NewAcknowledgment(serialized string) (*Acknowledgment, error)
NewAcknowledgment recreates acknowledgment object from serialized state.
func (*Acknowledgment) NoConsent ¶
func (a *Acknowledgment) NoConsent() error
NoConsent acknowledge verifier that user does not consent to the presentation request.
func (*Acknowledgment) NoMatchingCredential ¶
func (a *Acknowledgment) NoMatchingCredential() error
NoMatchingCredential acknowledge verifier that no matching credential was found.
func (*Acknowledgment) Serialize ¶
func (a *Acknowledgment) Serialize() (string, error)
Serialize the acknowledgment object so it can be restored later.
func (*Acknowledgment) SetInteractionDetails ¶
func (a *Acknowledgment) SetInteractionDetails(serializedInteractionDetails string) error
SetInteractionDetails extends acknowledgment request with serializedInteractionDetails.
func (*Acknowledgment) WithCode ¶
func (a *Acknowledgment) WithCode(code, desc string) error
WithCode sends acknowledgment message to verifier with the custom error code and description.
type Args ¶
type Args struct {
// contains filtered or unexported fields
}
Args contains the required parameters for an Interaction.
type CredentialClaimKeys ¶
type CredentialClaimKeys struct {
ContentJSON interface{}
}
CredentialClaimKeys represent credential claim keys.
type Interaction ¶
type Interaction struct {
// contains filtered or unexported fields
}
Interaction represents a single OpenID4VP interaction between a wallet and a verifier. The methods defined on this object are used to help guide the calling code through the OpenID4VP flow.
func NewInteraction ¶
func NewInteraction(args *Args, opts *Opts) (*Interaction, error)
NewInteraction creates a new OpenID4VP Interaction. The methods defined on this object are used to help guide the calling code through the OpenID4VP flow.
func (*Interaction) Acknowledgment ¶
func (o *Interaction) Acknowledgment() *Acknowledgment
Acknowledgment returns acknowledgment object.
func (*Interaction) CustomScope ¶
func (o *Interaction) CustomScope() *Scope
CustomScope returns vp integration scope.
func (*Interaction) GetQuery ¶
func (o *Interaction) GetQuery() ([]byte, error)
GetQuery creates query based on authorization request data.
func (*Interaction) OTelTraceID ¶
func (o *Interaction) OTelTraceID() string
OTelTraceID returns open telemetry trace id.
func (*Interaction) PresentCredential ¶
func (o *Interaction) PresentCredential(credentials *verifiable.CredentialsArray) error
PresentCredential presents credentials to redirect uri from request object.
func (*Interaction) PresentCredentialOpts ¶
func (o *Interaction) PresentCredentialOpts( credentials *verifiable.CredentialsArray, opts *PresentCredentialOpts, ) error
PresentCredentialOpts presents credentials to redirect uri from request object.
func (*Interaction) PresentCredentialUnsafe ¶
func (o *Interaction) PresentCredentialUnsafe(credential *verifiable.Credential) error
PresentCredentialUnsafe presents a single credential to redirect uri from request object.
Note: this variant of PresentCredential will skip client-side presentation definition constraint validation. All input descriptors will accept the provided credential, at least in terms of issuer fields, and subject data fields.
func (*Interaction) PresentedClaims ¶
func (o *Interaction) PresentedClaims(credential *verifiable.Credential) (*CredentialClaimKeys, error)
PresentedClaims returns vc presented claims.
func (*Interaction) TrustInfo ¶
func (o *Interaction) TrustInfo() (*VerifierTrustInfo, error)
TrustInfo return verifier trust info.
func (*Interaction) VerifierDisplayData ¶
func (o *Interaction) VerifierDisplayData() *VerifierDisplayData
VerifierDisplayData returns display information about verifier.
type Opts ¶
type Opts struct {
// contains filtered or unexported fields
}
Opts contains all optional arguments that can be passed into the NewInteraction function.
func (*Opts) AddHeader ¶
AddHeader adds the given HTTP header to all REST calls made to the issuer during the OpenID4CI flow.
func (*Opts) AddHeaders ¶
AddHeaders adds the given HTTP headers to all REST calls made to the verifier during the OpenID4VP flow.
func (*Opts) DisableHTTPClientTLSVerify ¶
DisableHTTPClientTLSVerify disables tls verification, should be used only for test purposes.
func (*Opts) DisableOpenTelemetry ¶
DisableOpenTelemetry disables sending of open telemetry header.
func (*Opts) EnableAddingDIProofs ¶
EnableAddingDIProofs enables the adding of data integrity proofs to presentations sent to the verifier. It requires a KMS to be passed in. Deprecated: DI proofs are now enabled by default. Their usage depends on the proof types supported by the verifier.
func (*Opts) SetActivityLogger ¶
func (o *Opts) SetActivityLogger(activityLogger api.ActivityLogger) *Opts
SetActivityLogger sets an activity logger to use.
func (*Opts) SetDocumentLoader ¶
func (o *Opts) SetDocumentLoader(documentLoader api.LDDocumentLoader) *Opts
SetDocumentLoader sets a document loader to use.
func (*Opts) SetHTTPTimeoutNanoseconds ¶
SetHTTPTimeoutNanoseconds sets the timeout (in nanoseconds) for HTTP calls. Passing in 0 will disable timeouts.
func (*Opts) SetMetricsLogger ¶
func (o *Opts) SetMetricsLogger(metricsLogger api.MetricsLogger) *Opts
SetMetricsLogger sets a metrics logger to use.
type PresentCredentialOpts ¶
type PresentCredentialOpts struct {
// contains filtered or unexported fields
}
PresentCredentialOpts contains options for present credential operation.
func NewPresentCredentialOpts ¶
func NewPresentCredentialOpts() *PresentCredentialOpts
NewPresentCredentialOpts returns a new PresentCredentialOpts object.
func (*PresentCredentialOpts) AddScopeClaim ¶
func (o *PresentCredentialOpts) AddScopeClaim(claimName, claimJSON string) *PresentCredentialOpts
AddScopeClaim adds scope claim with given name.
func (*PresentCredentialOpts) SetAttestationVC ¶
func (o *PresentCredentialOpts) SetAttestationVC( vm *api.VerificationMethod, vc string, ) *PresentCredentialOpts
SetAttestationVC is an option for the RequestCredentialWithPreAuth method that allows you to specify attestation VC, which may be required by the verifier.
func (*PresentCredentialOpts) SetInteractionDetails ¶
func (o *PresentCredentialOpts) SetInteractionDetails( serializedInteractionDetails string, ) *PresentCredentialOpts
SetInteractionDetails extends authorization response with interaction details.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope represents an array of scope strings. Since arrays and slices are not compatible with gomobile, this type acts as a wrapper around a Go array of strings.
type VerifierDisplayData ¶
type VerifierDisplayData struct {
// contains filtered or unexported fields
}
VerifierDisplayData represents display information for a verifier.
func (*VerifierDisplayData) DID ¶
func (v *VerifierDisplayData) DID() string
DID returns the verifier's DID.
func (*VerifierDisplayData) LogoURI ¶
func (v *VerifierDisplayData) LogoURI() string
LogoURI returns the verifier's logo URI.
func (*VerifierDisplayData) Name ¶
func (v *VerifierDisplayData) Name() string
Name returns the verifier's name.
func (*VerifierDisplayData) Purpose ¶
func (v *VerifierDisplayData) Purpose() string
Purpose returns the verifier's purpose.
type VerifierTrustInfo ¶
VerifierTrustInfo represent verifier trust information.