Documentation
¶
Index ¶
- Constants
- type Connection
- type ConnectionSignature
- type Invitation
- type Request
- type Response
- type Service
- func (s *Service) Accept(msgType string) bool
- func (s *Service) AcceptExchangeRequest(connectionID, publicDID, label string) error
- func (s *Service) AcceptInvitation(connectionID, publicDID, label string) error
- func (s *Service) CreateImplicitInvitation(inviterLabel, inviterDID, inviteeLabel, inviteeDID string) (string, error)
- func (s *Service) HandleInbound(msg service.DIDCommMsg, myDID, theirDID string) (string, error)
- func (s *Service) HandleOutbound(msg service.DIDCommMsg, myDID, theirDID string) error
- func (s *Service) Name() string
Constants ¶
const ( // DIDExchange did exchange protocol DIDExchange = "didexchange" // DIDExchangeSpec defines the did-exchange spec DIDExchangeSpec = "https://didcomm.org/didexchange/1.0/" // InvitationMsgType defines the did-exchange invite message type. InvitationMsgType = DIDExchangeSpec + "invitation" // RequestMsgType defines the did-exchange request message type. RequestMsgType = DIDExchangeSpec + "request" // ResponseMsgType defines the did-exchange response message type. ResponseMsgType = DIDExchangeSpec + "response" // AckMsgType defines the did-exchange ack message type. AckMsgType = DIDExchangeSpec + "ack" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { DID string `json:"did,omitempty"` DIDDoc *did.Doc `json:"did_doc,omitempty"` }
Connection connection
type ConnectionSignature ¶
type ConnectionSignature struct { Type string `json:"@type,omitempty"` Signature string `json:"signature,omitempty"` SignedData string `json:"sig_data,omitempty"` SignVerKey string `json:"signers,omitempty"` }
ConnectionSignature connection signature
type Invitation ¶
type Invitation struct { // the Image URL of the connection invitation ImageURL string `json:"imageUrl,omitempty"` // the Service endpoint of the connection invitation ServiceEndpoint string `json:"serviceEndpoint,omitempty"` // the RecipientKeys for the connection invitation RecipientKeys []string `json:"recipientKeys,omitempty"` // the ID of the connection invitation ID string `json:"@id,omitempty"` // the Label of the connection invitation Label string `json:"label,omitempty"` // the DID of the connection invitation DID string `json:"did,omitempty"` // the RoutingKeys of the connection invitation RoutingKeys []string `json:"routingKeys,omitempty"` // the Type of the connection invitation Type string `json:"@type,omitempty"` Thread *decorator.Thread `json:"~thread,omitempty"` }
Invitation model
Invitation defines DID exchange invitation message https://github.com/hyperledger/aries-rfcs/tree/master/features/0023-did-exchange#0-invitation-to-exchange
type Request ¶
type Request struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` Label string `json:"label,omitempty"` Connection *Connection `json:"connection,omitempty"` Thread *decorator.Thread `json:"~thread,omitempty"` }
Request defines a2a DID exchange request https://github.com/hyperledger/aries-rfcs/tree/master/features/0023-did-exchange#1-exchange-request
type Response ¶
type Response struct { Type string `json:"@type,omitempty"` ID string `json:"@id,omitempty"` ConnectionSignature *ConnectionSignature `json:"connection~sig,omitempty"` Thread *decorator.Thread `json:"~thread,omitempty"` }
Response defines a2a DID exchange response https://github.com/hyperledger/aries-rfcs/tree/master/features/0023-did-exchange#2-exchange-response
type Service ¶
Service for DID exchange protocol
func (*Service) AcceptExchangeRequest ¶
AcceptExchangeRequest accepts/approves connection request.
func (*Service) AcceptInvitation ¶
AcceptInvitation accepts/approves connection invitation.
func (*Service) CreateImplicitInvitation ¶ added in v0.1.1
func (s *Service) CreateImplicitInvitation(inviterLabel, inviterDID, inviteeLabel, inviteeDID string) (string, error)
CreateImplicitInvitation creates implicit invitation. Inviter DID is required, invitee DID is optional. If invitee DID is not provided new peer DID will be created for implicit invitation exchange request.
func (*Service) HandleInbound ¶
HandleInbound handles inbound didexchange messages.
func (*Service) HandleOutbound ¶
func (s *Service) HandleOutbound(msg service.DIDCommMsg, myDID, theirDID string) error
HandleOutbound handles outbound didexchange messages.