didcommwallet

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// InvalidRequestErrorCode is typically a code for invalid requests.
	InvalidRequestErrorCode = command.Code(iota + command.VCWallet)

	// DIDConnectErrorCode for errors while performing DID connect in wallet.
	DIDConnectErrorCode

	// ProposePresentationErrorCode for errors while proposing presentation.
	ProposePresentationErrorCode

	// PresentProofErrorCode for errors while presenting proof from wallet.
	PresentProofErrorCode

	// ProposeCredentialErrorCode for errors while proposing credential from wallet.
	ProposeCredentialErrorCode

	// RequestCredentialErrorCode for errors while request credential from wallet for issue credential protocol.
	RequestCredentialErrorCode
)

Error codes.

View Source
const (
	// command methods.
	ConnectMethod             = "Connect"
	ProposePresentationMethod = "ProposePresentation"
	PresentProofMethod        = "PresentProof"
	ProposeCredentialMethod   = "ProposeCredential"
	RequestCredentialMethod   = "RequestCredential"
)

All command operations.

View Source
const (
	LabelString = "label"
)

miscellaneous constants for the vc wallet command controller.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCapabilityProvider

type AuthCapabilityProvider = vcwallet.AuthCapabilityProvider

AuthCapabilityProvider is for providing Authorization Capabilities (ZCAP-LD) feature for wallet's EDV and WebKMS components.

type Command

type Command struct {
	*vcwallet.Command
	// contains filtered or unexported fields
}

Command extends vcwallet.Command to add didComm functionality.

func New

func New(p provider, config *Config) *Command

New returns new verifiable credential wallet controller command instance.

func (*Command) Connect

func (o *Command) Connect(rw io.Writer, req io.Reader) command.Error

Connect accepts out-of-band invitations and performs DID exchange.

func (*Command) GetHandlers

func (o *Command) GetHandlers() []command.Handler

GetHandlers returns list of all commands supported by this controller command.

func (*Command) PresentProof

func (o *Command) PresentProof(rw io.Writer, req io.Reader) command.Error

PresentProof sends present proof message from wallet to relying party. https://w3c-ccg.github.io/universal-wallet-interop-spec/#presentproof

Currently Supporting [0454-present-proof-v2](https://github.com/hyperledger/aries-rfcs/tree/master/features/0454-present-proof-v2)

func (*Command) ProposeCredential

func (o *Command) ProposeCredential(rw io.Writer, req io.Reader) command.Error

ProposeCredential sends propose credential message from wallet to issuer. https://w3c-ccg.github.io/universal-wallet-interop-spec/#proposecredential

Currently Supporting : 0453-issueCredentialV2 https://github.com/hyperledger/aries-rfcs/blob/main/features/0453-issue-credential-v2/README.md

func (*Command) ProposePresentation

func (o *Command) ProposePresentation(rw io.Writer, req io.Reader) command.Error

ProposePresentation accepts out-of-band invitation and sends message proposing presentation from wallet to relying party. https://w3c-ccg.github.io/universal-wallet-interop-spec/#proposepresentation

Currently Supporting [0454-present-proof-v2](https://github.com/hyperledger/aries-rfcs/tree/master/features/0454-present-proof-v2)

func (*Command) RequestCredential

func (o *Command) RequestCredential(rw io.Writer, req io.Reader) command.Error

RequestCredential sends request credential message from wallet to issuer and optionally waits for credential response. https://w3c-ccg.github.io/universal-wallet-interop-spec/#requestcredential

Currently Supporting : 0453-issueCredentialV2 https://github.com/hyperledger/aries-rfcs/blob/main/features/0453-issue-credential-v2/README.md

type Config

type Config = vcwallet.Config

Config contains properties to customize verifiable credential wallet controller. All properties of this config are optional, but they can be used to customize wallet's webkms and edv client's.

type ConnectOpts

type ConnectOpts struct {
	// Label to be shared with the other agent during the subsequent DID exchange.
	MyLabel string `json:"myLabel,omitempty"`

	// router connections to be used to establish connection.
	RouterConnections []string `json:"routerConnections,omitempty"`

	// DID to be used when reusing a connection.
	ReuseConnection string `json:"reuseConnection,omitempty"`

	// To use any recognized DID in the services array for a reusable connection.
	ReuseAnyConnection bool `json:"reuseAnyConnection,omitempty"`

	// Timeout (in milliseconds) waiting for connection status to be completed.
	Timeout time.Duration `json:"timeout,omitempty"`
}

ConnectOpts is option for accepting out-of-band invitation and to perform DID exchange.

type ConnectRequest

type ConnectRequest struct {
	vcwallet.WalletAuth

	// out-of-band invitation to establish connection.
	Invitation *outofband.Invitation `json:"invitation"`

	ConnectOpts
}

ConnectRequest is request model for wallet DID connect operation.

type ConnectResponse

type ConnectResponse struct {
	// connection ID of the connection established.
	ConnectionID string `json:"connectionID"`
}

ConnectResponse is response model from wallet DID connection operation.

type HTTPHeaderSigner

type HTTPHeaderSigner = vcwallet.HTTPHeaderSigner

HTTPHeaderSigner is for http header signing, typically used for zcapld functionality.

type PresentProofRequest

type PresentProofRequest struct {
	vcwallet.WalletAuth

	// Thread ID from request presentation response
	ThreadID string `json:"threadID,omitempty"`

	// presentation to be sent as part of present proof message.
	Presentation json.RawMessage `json:"presentation,omitempty"`

	// If true then wallet will wait for present proof protocol status to be
	// done or abandoned till given Timeout.
	// Also, will return web redirect info if found in acknowledgment message or problem-report.
	WaitForDone bool `json:"waitForDone,omitempty"`

	// Optional timeout (in milliseconds) waiting for present proof operation to be done.
	// will be taken into account only when WaitForDone is enabled.
	// If not provided then wallet will use its default timeout.
	Timeout time.Duration `json:"WaitForDoneTimeout,omitempty"`
}

PresentProofRequest is request model from wallet present proof operation. Supported attachment MIME type "application/ld+json".

type PresentProofResponse

type PresentProofResponse struct {
	wallet.CredentialInteractionStatus
}

PresentProofResponse is response model from wallet present proof operation.

type ProposeCredentialRequest

type ProposeCredentialRequest struct {
	vcwallet.WalletAuth

	// out-of-band invitation to establish connection and send propose credential message.
	Invitation *wallet.GenericInvitation `json:"invitation"`

	// Optional From DID option to customize sender DID.
	FromDID string `json:"from,omitempty"`

	// Timeout (in milliseconds) waiting for operation to be completed.
	Timeout time.Duration `json:"timeout,omitempty"`

	// Options for accepting out-of-band invitation and to perform DID exchange (for DIDComm V1).
	ConnectionOpts ConnectOpts `json:"connectOptions,omitempty"`
}

ProposeCredentialRequest is request model for performing propose credential operation from wallet.

type ProposeCredentialResponse

type ProposeCredentialResponse struct {
	// response offer credential message from issuer.
	OfferCredential *service.DIDCommMsgMap `json:"offerCredential,omitempty"`
}

ProposeCredentialResponse is response model from wallet propose credential operation.

type ProposePresentationRequest

type ProposePresentationRequest struct {
	vcwallet.WalletAuth

	// out-of-band invitation to establish connection and send propose presentation message.
	Invitation *wallet.GenericInvitation `json:"invitation"`

	// Optional From DID option to customize sender DID.
	FromDID string `json:"from,omitempty"`

	// Timeout (in milliseconds) waiting for operation to be completed.
	Timeout time.Duration `json:"timeout,omitempty"`

	// Options for accepting out-of-band invitation and to perform DID exchange (for DIDComm V1).
	ConnectionOpts ConnectOpts `json:"connectOptions,omitempty"`
}

ProposePresentationRequest is request model for performing propose presentation operation from wallet.

type ProposePresentationResponse

type ProposePresentationResponse struct {
	// response request presentation message from  relying party.
	PresentationRequest *service.DIDCommMsgMap `json:"presentationRequest,omitempty"`
}

ProposePresentationResponse is response model from wallet propose presentation operation.

type RequestCredentialRequest

type RequestCredentialRequest struct {
	vcwallet.WalletAuth

	// Thread ID from offer credential response previously received during propose credential interaction.
	ThreadID string `json:"threadID,omitempty"`

	// presentation to be sent as part of request credential message.
	Presentation json.RawMessage `json:"presentation,omitempty"`

	// If true then wallet will wait till it receives credential response response from issuer for given Timeout.
	// Also, will return web redirect info if found in response message or problem-report.
	WaitForDone bool `json:"waitForDone,omitempty"`

	// Optional timeout (in milliseconds) waiting for credential response to arrive.
	// will be taken into account only when WaitForDone is enabled.
	// If not provided then wallet will use its default timeout.
	Timeout time.Duration `json:"WaitForDoneTimeout,omitempty"`
}

RequestCredentialRequest is request model from wallet request credential operation. Supported attachment MIME type "application/ld+json".

type RequestCredentialResponse

type RequestCredentialResponse struct {
	wallet.CredentialInteractionStatus
}

RequestCredentialResponse is response model from wallet request credential operation.

Jump to

Keyboard shortcuts

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