issuecredential

package
v0.0.0-...-57c6170 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name defines the protocol name.
	Name = "issue-credential"
	// SpecV2 defines the protocol spec V2.
	SpecV2 = "https://didcomm.org/issue-credential/2.0/"
	// ProposeCredentialMsgTypeV2 defines the protocol propose-credential message type.
	ProposeCredentialMsgTypeV2 = SpecV2 + "propose-credential"
	// OfferCredentialMsgTypeV2 defines the protocol offer-credential message type.
	OfferCredentialMsgTypeV2 = SpecV2 + "offer-credential"
	// RequestCredentialMsgTypeV2 defines the protocol request-credential message type.
	RequestCredentialMsgTypeV2 = SpecV2 + "request-credential"
	// IssueCredentialMsgTypeV2 defines the protocol issue-credential message type.
	IssueCredentialMsgTypeV2 = SpecV2 + "issue-credential"
	// AckMsgTypeV2 defines the protocol ack message type.
	AckMsgTypeV2 = SpecV2 + "ack"
	// ProblemReportMsgTypeV2 defines the protocol problem-report message type.
	ProblemReportMsgTypeV2 = SpecV2 + "problem-report"
	// CredentialPreviewMsgTypeV2 defines the protocol credential-preview inner object type.
	CredentialPreviewMsgTypeV2 = SpecV2 + "credential-preview"

	// SpecV3 defines the protocol spec V3.
	SpecV3 = "https://didcomm.org/issue-credential/3.0/"
	// ProposeCredentialMsgTypeV3 defines the protocol propose-credential message type.
	ProposeCredentialMsgTypeV3 = SpecV3 + "propose-credential"
	// OfferCredentialMsgTypeV3 defines the protocol offer-credential message type.
	OfferCredentialMsgTypeV3 = SpecV3 + "offer-credential"
	// RequestCredentialMsgTypeV3 defines the protocol request-credential message type.
	RequestCredentialMsgTypeV3 = SpecV3 + "request-credential"
	// IssueCredentialMsgTypeV3 defines the protocol issue-credential message type.
	IssueCredentialMsgTypeV3 = SpecV3 + "issue-credential"
	// AckMsgTypeV3 defines the protocol ack message type.
	AckMsgTypeV3 = SpecV3 + "ack"
	// ProblemReportMsgTypeV3 defines the protocol problem-report message type.
	ProblemReportMsgTypeV3 = SpecV3 + "problem-report"
	// CredentialPreviewMsgTypeV3 defines the protocol credential-preview inner object type.
	CredentialPreviewMsgTypeV3 = SpecV3 + "credential-preview"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Protocol instance ID
	PIID     string
	Msg      service.DIDCommMsgMap
	MyDID    string
	TheirDID string
}

Action contains helpful information about action.

type Attribute

type Attribute struct {
	Name     string `json:"name,omitempty"`
	MimeType string `json:"mime-type,omitempty"`
	Value    string `json:"value,omitempty"`
}

Attribute describes an attribute for a Preview Credential.

type Format

type Format struct {
	AttachID string `json:"attach_id,omitempty"`
	Format   string `json:"format,omitempty"`
}

Format contains the value of the attachment @id and the verifiable credential format of the attachment.

type Handler

type Handler interface {
	Handle(metadata Metadata) error
}

Handler describes middleware interface.

type HandlerFunc

type HandlerFunc func(metadata Metadata) error

HandlerFunc is a helper type which implements the middleware Handler interface.

func (HandlerFunc) Handle

func (hf HandlerFunc) Handle(metadata Metadata) error

Handle implements function to satisfy the Handler interface.

type IssueCredentialParams

type IssueCredentialParams struct {
	Type          string
	ID            string
	Comment       string
	Formats       []Format
	Attachments   []decorator.GenericAttachment
	GoalCode      string
	ReplacementID string
	WebRedirect   *decorator.WebRedirect
}

IssueCredentialParams holds parameters for a credential issuance message.

func (*IssueCredentialParams) AsV2

AsV2 translates this credential issuance into an issue credential 2.0 issuance message.

func (*IssueCredentialParams) AsV3

AsV3 translates this credential issuance into an issue credential 3.0 issuance message.

func (*IssueCredentialParams) FromDIDCommMsgMap

func (p *IssueCredentialParams) FromDIDCommMsgMap(msgMap service.DIDCommMsgMap) error

FromDIDCommMsgMap implements service.MsgMapDecoder.

func (*IssueCredentialParams) FromV2

FromV2 initializes this credential issuance from an issue credential 2.0 issuance message.

func (*IssueCredentialParams) FromV3

FromV3 initialized this credential issuance from an issue credential 3.0 issuance message.

func (*IssueCredentialParams) UnmarshalJSON

func (p *IssueCredentialParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IssueCredentialV2

type IssueCredentialV2 struct {
	Type string `json:"@type,omitempty"`
	// Comment is an optional field that provides human readable information about this Credential Offer,
	// so the offer can be evaluated by human judgment.
	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300].
	Comment string `json:"comment,omitempty"`
	// Formats contains an entry for each credentials~attach array entry, providing the value
	// of the attachment @id and the verifiable credential format and version of the attachment.
	Formats []Format `json:"formats,omitempty"`
	// CredentialsAttach is a slice of attachments containing the issued credentials.
	CredentialsAttach []decorator.Attachment `json:"credentials~attach,omitempty"`
	// WebRedirect contains optional web redirect info to be sent to holder for redirect.
	WebRedirect *decorator.WebRedirect `json:"~web-redirect,omitempty"`
}

IssueCredentialV2 contains as attached payload the credentials being issued and is sent in response to a valid Invitation Credential message. TODO: Need to add ~please-ack decorator [Issue #1299].

type IssueCredentialV3

type IssueCredentialV3 struct {
	Type string                `json:"type,omitempty"`
	ID   string                `json:"id,omitempty"`
	Body IssueCredentialV3Body `json:"body,omitempty"`
	// WebRedirect contains optional web redirect info to be sent to holder for redirect.
	WebRedirect *decorator.WebRedirect `json:"web_redirect,omitempty"`
	// Attachments is an array of attachments containing the presentation in the requested format(s).
	// Accepted values for the format attribute of each attachment are provided in the per format Attachment
	// registry immediately below.
	Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"`
}

IssueCredentialV3 contains as attached payload the credentials being issued and is sent in response to a valid Invitation Credential message.

type IssueCredentialV3Body

type IssueCredentialV3Body struct {
	GoalCode      string `json:"goal_code,omitempty"`
	ReplacementID string `json:"replacement_id,omitempty"`
	Comment       string `json:"comment,omitempty"`
}

IssueCredentialV3Body represents body for IssueCredentialV3.

type MetaData

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

MetaData type to store data for internal usage.

func (*MetaData) CredentialNames

func (md *MetaData) CredentialNames() []string

CredentialNames are the names with which to save credentials with.

func (*MetaData) IssueCredentialV2

func (md *MetaData) IssueCredentialV2() *IssueCredentialV2

IssueCredentialV2 didcomm message.

func (*MetaData) IssueCredentialV3

func (md *MetaData) IssueCredentialV3() *IssueCredentialV3

IssueCredentialV3 didcomm message.

func (*MetaData) Message

func (md *MetaData) Message() service.DIDCommMsg

Message is the didcomm message.

func (*MetaData) OfferCredentialV2

func (md *MetaData) OfferCredentialV2() *OfferCredentialV2

OfferCredentialV2 didcomm message.

func (*MetaData) OfferCredentialV3

func (md *MetaData) OfferCredentialV3() *OfferCredentialV3

OfferCredentialV3 didcomm message.

func (*MetaData) Properties

func (md *MetaData) Properties() map[string]interface{}

Properties returns metadata properties.

func (*MetaData) ProposeCredentialV2

func (md *MetaData) ProposeCredentialV2() *ProposeCredentialV2

ProposeCredentialV2 didcomm message.

func (*MetaData) ProposeCredentialV3

func (md *MetaData) ProposeCredentialV3() *ProposeCredentialV3

ProposeCredentialV3 didcomm message.

func (*MetaData) RequestCredentialV2

func (md *MetaData) RequestCredentialV2() *RequestCredentialV2

RequestCredentialV2 didcomm message.

func (*MetaData) RequestCredentialV3

func (md *MetaData) RequestCredentialV3() *RequestCredentialV3

RequestCredentialV3 didcomm message.

func (*MetaData) StateName

func (md *MetaData) StateName() string

StateName returns the name of the currently executing state.

type Metadata

type Metadata interface {
	// Message contains the original inbound/outbound message
	Message() service.DIDCommMsg
	// OfferCredentialV2 is pointer to the message provided by the user through the Continue function.
	OfferCredentialV2() *OfferCredentialV2
	// ProposeCredentialV2 is pointer to the message provided by the user through the Continue function.
	ProposeCredentialV2() *ProposeCredentialV2
	// IssueCredential is pointer to the message provided by the user through the Continue function.
	IssueCredentialV2() *IssueCredentialV2
	// RequestCredential is pointer to message provided by the user through the Continue function.
	RequestCredentialV2() *RequestCredentialV2
	// CredentialNames is a slice which contains credential names provided by the user through the Continue function.
	CredentialNames() []string
	// StateName provides the state name
	StateName() string
	// Properties provides the possibility to set properties
	Properties() map[string]interface{}
}

Metadata provides helpful information for the processing.

type Middleware

type Middleware func(next Handler) Handler

Middleware function receives next handler and returns handler that needs to be executed.

type OfferCredentialParams

type OfferCredentialParams struct {
	Type              string
	ID                string
	Comment           string
	Attachments       []decorator.GenericAttachment
	Formats           []Format
	GoalCode          string
	ReplacementID     string
	CredentialPreview interface{}
}

OfferCredentialParams holds parameters for a credential offer message.

func (*OfferCredentialParams) AsV2

AsV2 translates this credential offer into an issue credential 2.0 offer message.

func (*OfferCredentialParams) AsV3

AsV3 translates this credential offer into an issue credential 3.0 offer message.

func (*OfferCredentialParams) FromDIDCommMsgMap

func (p *OfferCredentialParams) FromDIDCommMsgMap(msgMap service.DIDCommMsgMap) error

FromDIDCommMsgMap implements service.MsgMapDecoder.

func (*OfferCredentialParams) FromV2

FromV2 initializes this credential offer from an issue credential 2.0 offer message.

func (*OfferCredentialParams) FromV3

FromV3 initializes this credential offer from an issue credential 3.0 offer message.

func (*OfferCredentialParams) UnmarshalJSON

func (p *OfferCredentialParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type OfferCredentialV2

type OfferCredentialV2 struct {
	Type string `json:"@type,omitempty"`
	// Comment is an optional field that provides human readable information about this Credential Offer,
	// so the offer can be evaluated by human judgment.
	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300].
	Comment string `json:"comment,omitempty"`
	// CredentialPreview is a JSON-LD object that represents the credential data that Issuer is willing to issue.
	CredentialPreview PreviewCredential `json:"credential_preview,omitempty"`
	// Formats contains an entry for each offers~attach array entry, providing the the value
	// of the attachment @id and the verifiable credential format and version of the attachment.
	Formats []Format `json:"formats,omitempty"`
	// OffersAttach is a slice of attachments that further define the credential being offered.
	// This might be used to clarify which formats or format versions will be issued.
	OffersAttach []decorator.Attachment `json:"offers~attach,omitempty"`
}

OfferCredentialV2 is a message sent by the Issuer to the potential Holder, describing the credential they intend to offer and possibly the price they expect to be paid. TODO: Need to add ~payment_request and ~timing.expires_time decorators [Issue #1297].

type OfferCredentialV3

type OfferCredentialV3 struct {
	Type string                `json:"type,omitempty"`
	ID   string                `json:"id,omitempty"`
	Body OfferCredentialV3Body `json:"body,omitempty"`
	// Attachments is an array of attachments containing the presentation in the requested format(s).
	// Accepted values for the format attribute of each attachment are provided in the per format Attachment
	// registry immediately below.
	Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"`
}

OfferCredentialV3 is a message sent by the Issuer to the potential Holder, describing the credential they intend to offer and possibly the price they expect to be paid.

type OfferCredentialV3Body

type OfferCredentialV3Body struct {
	GoalCode      string `json:"goal_code,omitempty"`
	Comment       string `json:"comment,omitempty"`
	ReplacementID string `json:"replacement_id,omitempty"`
	// credentialPreview is an optional JSON-LD object that represents the credential data that Prover wants to receive.
	CredentialPreview interface{} `json:"credential_preview,omitempty"`
}

OfferCredentialV3Body represents body for OfferCredentialV3.

type Opt

type Opt func(md *MetaData)

Opt describes option signature for the Continue function.

func WithFriendlyNames

func WithFriendlyNames(names ...string) Opt

WithFriendlyNames allows providing names for the credentials. USAGE: This function should be used when the Holder receives IssueCredentialV2 message.

func WithIssueCredential

func WithIssueCredential(msg *IssueCredentialParams) Opt

WithIssueCredential allows providing IssueCredential message USAGE: This message should be provided after receiving a RequestCredential message.

func WithIssueCredentialV2

func WithIssueCredentialV2(msg *IssueCredentialV2) Opt

WithIssueCredentialV2 allows providing IssueCredentialV2 message USAGE: This message should be provided after receiving a RequestCredentialV2 message.

func WithIssueCredentialV3

func WithIssueCredentialV3(msg *IssueCredentialV3) Opt

WithIssueCredentialV3 allows providing IssueCredentialV3 message USAGE: This message should be provided after receiving a RequestCredentialV3 message.

func WithOfferCredential

func WithOfferCredential(msg *OfferCredentialParams) Opt

WithOfferCredential allows providing OfferCredential message USAGE: This message should be provided after receiving a ProposeCredential message.

func WithOfferCredentialV2

func WithOfferCredentialV2(msg *OfferCredentialV2) Opt

WithOfferCredentialV2 allows providing OfferCredentialV2 message USAGE: This message should be provided after receiving a ProposeCredentialV2 message.

func WithOfferCredentialV3

func WithOfferCredentialV3(msg *OfferCredentialV3) Opt

WithOfferCredentialV3 allows providing OfferCredentialV3 message USAGE: This message should be provided after receiving a ProposeCredentialV3 message.

func WithProperties

func WithProperties(props map[string]interface{}) Opt

WithProperties allows providing custom properties.

func WithProposeCredential

func WithProposeCredential(msg *ProposeCredentialParams) Opt

WithProposeCredential allows providing ProposeCredential message USAGE: This message should be provided after receiving an OfferCredential message.

func WithProposeCredentialV2

func WithProposeCredentialV2(msg *ProposeCredentialV2) Opt

WithProposeCredentialV2 allows providing ProposeCredentialV2 message USAGE: This message should be provided after receiving an OfferCredentialV2 message.

func WithProposeCredentialV3

func WithProposeCredentialV3(msg *ProposeCredentialV3) Opt

WithProposeCredentialV3 allows providing ProposeCredentialV3 message USAGE: This message should be provided after receiving an OfferCredentialV3 message.

func WithRequestCredential

func WithRequestCredential(msg *RequestCredentialParams) Opt

WithRequestCredential allows providing RequestCredential message USAGE: This message should be provided after receiving an OfferCredential message.

func WithRequestCredentialV2

func WithRequestCredentialV2(msg *RequestCredentialV2) Opt

WithRequestCredentialV2 allows providing RequestCredentialV2 message USAGE: This message should be provided after receiving an OfferCredentialV2 message.

func WithRequestCredentialV3

func WithRequestCredentialV3(msg *RequestCredentialV3) Opt

WithRequestCredentialV3 allows providing RequestCredentialV3 message USAGE: This message should be provided after receiving an OfferCredentialV3 message.

type PreviewCredential

type PreviewCredential struct {
	Type       string      `json:"@type,omitempty"`
	Attributes []Attribute `json:"attributes,omitempty"`
}

PreviewCredential is used to construct a preview of the data for the credential that is to be issued.

type PreviewCredentialV3

type PreviewCredentialV3 struct {
	Type string                `json:"type,omitempty"`
	ID   string                `json:"id,omitempty"`
	Body IssueCredentialV3Body `json:"body,omitempty"`
}

PreviewCredentialV3 is used to construct a preview of the data for the credential that is to be issued.

type PreviewCredentialV3Body

type PreviewCredentialV3Body struct {
	Attributes []Attribute `json:"attributes,omitempty"`
}

PreviewCredentialV3Body represents body for PreviewCredentialV3.

type ProposeCredentialParams

type ProposeCredentialParams struct {
	Type               string
	ID                 string
	Comment            string
	Attachments        []decorator.GenericAttachment
	CredentialProposal PreviewCredential
	Formats            []Format
	GoalCode           string
	CredentialPreview  interface{}
	InvitationID       string
}

ProposeCredentialParams holds parameters for a credential proposal message.

func (*ProposeCredentialParams) AsV2

AsV2 translates this credential proposal into an issue credential 2.0 proposal message.

func (*ProposeCredentialParams) AsV3

AsV3 translates this credential proposal into an issue credential 3.0 proposal message.

func (*ProposeCredentialParams) FromDIDCommMsgMap

func (p *ProposeCredentialParams) FromDIDCommMsgMap(msgMap service.DIDCommMsgMap) error

FromDIDCommMsgMap implements service.MsgMapDecoder.

func (*ProposeCredentialParams) FromV2

FromV2 initializes this credential proposal from an issue credential 2.0 proposal.

func (*ProposeCredentialParams) FromV3

FromV3 initializes this credential proposal from an issue credential 3.0 proposal.

func (*ProposeCredentialParams) UnmarshalJSON

func (p *ProposeCredentialParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ProposeCredentialV2

type ProposeCredentialV2 struct {
	Type string `json:"@type,omitempty"`
	// Comment is an optional field that provides human readable information about this Credential Offer,
	// so the offer can be evaluated by human judgment.
	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300]
	Comment string `json:"comment,omitempty"`
	// CredentialProposal is an optional JSON-LD object that represents
	// the credential data that the Prover wants to receive.
	CredentialProposal PreviewCredential `json:"credential_proposal,omitempty"`
	// Formats contains an entry for each filters~attach array entry, providing the the value of the attachment @id
	// and the verifiable credential format and version of the attachment.
	Formats []Format `json:"formats,omitempty"`
	// FiltersAttach is an array of attachments that further define the credential being proposed.
	// This might be used to clarify which formats or format versions are wanted.
	FiltersAttach []decorator.Attachment `json:"filters~attach,omitempty"`
	// Optional field containing ID of the invitation which initiated this protocol.
	InvitationID string `json:"invitationID,omitempty"`
}

ProposeCredentialV2 is an optional message sent by the potential Holder to the Issuer to initiate the protocol or in response to a offer-credential message when the Holder wants some adjustments made to the credential data offered by Issuer.

type ProposeCredentialV3

type ProposeCredentialV3 struct {
	Type string                  `json:"type,omitempty"`
	ID   string                  `json:"id,omitempty"`
	Body ProposeCredentialV3Body `json:"body,omitempty"`
	// Attachments is an array of attachments containing the presentation in the requested format(s).
	// Accepted values for the format attribute of each attachment are provided in the per format Attachment
	// registry immediately below.
	Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"`
	// Optional field containing ID of the invitation which initiated this protocol.
	InvitationID string `json:"pthid,omitempty"`
}

ProposeCredentialV3 is an optional message sent by the potential Holder to the Issuer to initiate the protocol or in response to a offer-credential message when the Holder wants some adjustments made to the credential data offered by Issuer.

type ProposeCredentialV3Body

type ProposeCredentialV3Body struct {
	GoalCode string `json:"goal_code,omitempty"`
	Comment  string `json:"comment,omitempty"`
	// credentialPreview is an optional JSON-LD object that represents the credential data that Prover wants to receive.
	CredentialPreview interface{} `json:"credential_preview,omitempty"`
}

ProposeCredentialV3Body represents body for ProposeCredentialV3.

type Provider

type Provider interface {
	Messenger() service.Messenger
	StorageProvider() storage.Provider
}

Provider contains dependencies for the protocol and is typically created by using aries.Context().

type RequestCredentialParams

type RequestCredentialParams struct {
	ID          string
	Type        string
	Comment     string
	Formats     []Format
	GoalCode    string
	Attachments []decorator.GenericAttachment
}

RequestCredentialParams holds parameters for a credential request message.

func (*RequestCredentialParams) AsV2

AsV2 translates this credential request into an issue credential 2.0 request message.

func (*RequestCredentialParams) AsV3

AsV3 translates this credential request into an issue credential 3.0 request message.

func (*RequestCredentialParams) FromDIDCommMsgMap

func (p *RequestCredentialParams) FromDIDCommMsgMap(msgMap service.DIDCommMsgMap) error

FromDIDCommMsgMap implements service.MsgMapDecoder.

func (*RequestCredentialParams) FromV2

FromV2 initializes this credential request from an issue credential 2.0 request message.

func (*RequestCredentialParams) FromV3

FromV3 initialized this credential request from an issue credential 3.0 request message.

func (*RequestCredentialParams) UnmarshalJSON

func (p *RequestCredentialParams) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RequestCredentialV2

type RequestCredentialV2 struct {
	Type string `json:"@type,omitempty"`
	// Comment is an optional field that provides human readable information about this Credential Offer,
	// so the offer can be evaluated by human judgment.
	// TODO: Should follow DIDComm conventions for l10n. [Issue #1300].
	Comment string `json:"comment,omitempty"`
	// Formats contains an entry for each requests~attach array entry, providing the the value
	// of the attachment @id and the verifiable credential format and version of the attachment.
	Formats []Format `json:"formats,omitempty"`
	// RequestsAttach is a slice of attachments defining the requested formats for the credential
	RequestsAttach []decorator.Attachment `json:"requests~attach,omitempty"`
}

RequestCredentialV2 is a message sent by the potential Holder to the Issuer, to request the issuance of a credential. Where circumstances do not require a preceding Offer Credential message (e.g., there is no cost to issuance that the Issuer needs to explain in advance, and there is no need for cryptographic negotiation), this message initiates the protocol. TODO: Need to add ~payment-receipt decorator [Issue #1298].

type RequestCredentialV3

type RequestCredentialV3 struct {
	Type string                  `json:"type,omitempty"`
	ID   string                  `json:"id,omitempty"`
	Body RequestCredentialV3Body `json:"body,omitempty"`
	// Attachments is an array of attachments containing the presentation in the requested format(s).
	// Accepted values for the format attribute of each attachment are provided in the per format Attachment
	// registry immediately below.
	Attachments []decorator.AttachmentV2 `json:"attachments,omitempty"`
}

RequestCredentialV3 is a message sent by the potential Holder to the Issuer, to request the issuance of a credential. Where circumstances do not require a preceding Offer Credential message (e.g., there is no cost to issuance that the Issuer needs to explain in advance, and there is no need for cryptographic negotiation), this message initiates the protocol.

type RequestCredentialV3Body

type RequestCredentialV3Body struct {
	GoalCode string `json:"goal_code,omitempty"`
	Comment  string `json:"comment,omitempty"`
}

RequestCredentialV3Body represents body for RequestCredentialV3.

type Service

type Service struct {
	service.Action
	service.Message
	// contains filtered or unexported fields
}

Service for the issuecredential protocol.

func New

func New(p Provider) (*Service, error)

New returns the issuecredential service.

func (*Service) Accept

func (s *Service) Accept(msgType string) bool

Accept msg checks the msg type.

func (*Service) ActionContinue

func (s *Service) ActionContinue(piID string, opts ...Opt) error

ActionContinue allows proceeding with the action by the piID.

func (*Service) ActionStop

func (s *Service) ActionStop(piID string, cErr error, opts ...Opt) error

ActionStop allows stopping the action by the piID.

func (*Service) Actions

func (s *Service) Actions() ([]Action, error)

Actions returns actions for the async usage.

func (*Service) AddMiddleware

func (s *Service) AddMiddleware(mw ...Middleware)

AddMiddleware appends the given Middleware to the chain of middlewares.

func (*Service) HandleInbound

func (s *Service) HandleInbound(msg service.DIDCommMsg, ctx service.DIDCommContext) (string, error)

HandleInbound handles inbound message (issuecredential protocol).

func (*Service) HandleOutbound

func (s *Service) HandleOutbound(msg service.DIDCommMsg, myDID, theirDID string) (string, error)

HandleOutbound handles outbound message (issuecredential protocol).

func (*Service) Initialize

func (s *Service) Initialize(prov interface{}) error

Initialize initializes the Service. If Initialize succeeds, any further call is a no-op.

func (*Service) Name

func (s *Service) Name() string

Name returns service name.

func (*Service) Use

func (s *Service) Use(items ...Middleware)

Use allows providing middlewares.

Jump to

Keyboard shortcuts

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