Documentation
¶
Index ¶
- Constants
- type Connection
- type ConnectionRecord
- type ConnectionRecorder
- func (c *ConnectionRecorder) GetConnectionRecord(connectionID string) (*ConnectionRecord, error)
- func (c *ConnectionRecorder) GetConnectionRecordAtState(connectionID, stateID string) (*ConnectionRecord, error)
- func (c *ConnectionRecorder) GetConnectionRecordByNSThreadID(nsThreadID string) (*ConnectionRecord, error)
- func (c *ConnectionRecorder) GetInvitation(id string) (*Invitation, error)
- func (c *ConnectionRecorder) QueryConnectionRecords() ([]*ConnectionRecord, error)
- func (c *ConnectionRecorder) SaveInvitation(invitation *Invitation) error
- type ConnectionSignature
- type Invitation
- type Request
- type Response
- type Service
- func (s *Service) Accept(msgType string) bool
- func (s *Service) AcceptExchangeRequest(connectionID string) error
- func (s *Service) AcceptInvitation(connectionID string) error
- func (s *Service) HandleInbound(msg *service.DIDCommMsg) (string, error)
- func (s *Service) HandleOutbound(msg *service.DIDCommMsg, destination *service.Destination) 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 ConnectionRecord ¶
type ConnectionRecord struct {
ConnectionID string
State string
ThreadID string
TheirLabel string
TheirDID string
MyDID string
ServiceEndPoint string
RecipientKeys []string
InvitationID string
Namespace string
}
ConnectionRecord contain info about did exchange connection
type ConnectionRecorder ¶
type ConnectionRecorder struct {
// contains filtered or unexported fields
}
ConnectionRecorder takes care of connection related persistence features
func NewConnectionRecorder ¶
func NewConnectionRecorder(transientStore, store storage.Store) *ConnectionRecorder
NewConnectionRecorder returns new connection record instance
func (*ConnectionRecorder) GetConnectionRecord ¶
func (c *ConnectionRecorder) GetConnectionRecord(connectionID string) (*ConnectionRecord, error)
GetConnectionRecord return connection record based on the connection ID
func (*ConnectionRecorder) GetConnectionRecordAtState ¶
func (c *ConnectionRecorder) GetConnectionRecordAtState(connectionID, stateID string) (*ConnectionRecord, error)
GetConnectionRecordAtState return connection record based on the connection ID and state.
func (*ConnectionRecorder) GetConnectionRecordByNSThreadID ¶
func (c *ConnectionRecorder) GetConnectionRecordByNSThreadID(nsThreadID string) (*ConnectionRecord, error)
GetConnectionRecordByNSThreadID return connection record via namespaced threadID
func (*ConnectionRecorder) GetInvitation ¶
func (c *ConnectionRecorder) GetInvitation(id string) (*Invitation, error)
GetInvitation returns invitation for given key from underlying store and stores the result in the value pointed to by v
Args:
id: invitation id
Returns:
invitation found error: error
func (*ConnectionRecorder) QueryConnectionRecords ¶
func (c *ConnectionRecorder) QueryConnectionRecords() ([]*ConnectionRecord, error)
QueryConnectionRecords returns connection records found in underlying store for given query criteria
func (*ConnectionRecorder) SaveInvitation ¶
func (c *ConnectionRecorder) SaveInvitation(invitation *Invitation) error
SaveInvitation saves connection invitation to underlying store
Args:
verKey: recipient key of the invitation object to be saved in store invitation: invitation to be stored
Returns:
error: error
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"`
}
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 New ¶
func New(didMaker didcreator.Creator, prov provider) (*Service, error)
New return didexchange service
func (*Service) AcceptExchangeRequest ¶
AcceptExchangeRequest accepts/approves connection request.
func (*Service) AcceptInvitation ¶
AcceptInvitation accepts/approves connection invitation.
func (*Service) HandleInbound ¶
func (s *Service) HandleInbound(msg *service.DIDCommMsg) (string, error)
HandleInbound handles inbound didexchange messages.
func (*Service) HandleOutbound ¶
func (s *Service) HandleOutbound(msg *service.DIDCommMsg, destination *service.Destination) error
HandleOutbound handles outbound didexchange messages.