Documentation ¶
Index ¶
- type DIDCommMessageMiddleware
- func (h *DIDCommMessageMiddleware) Create(oldDoc *did.Doc, oldKID, newDID string) (string, error)
- func (h *DIDCommMessageMiddleware) HandleInboundMessage(msg didcomm.DIDCommMsgMap, theirDID, myDID string) error
- func (h *DIDCommMessageMiddleware) HandleInboundPeerDID(msg didcomm.DIDCommMsgMap) error
- func (h *DIDCommMessageMiddleware) HandleOutboundMessage(msg didcomm.DIDCommMsgMap, rec *connection.Record) didcomm.DIDCommMsgMap
- func (h *DIDCommMessageMiddleware) RotateConnectionDID(connectionID, signingKID, newDID string) error
- func (h *DIDCommMessageMiddleware) Verify(senderDID, fromPrior string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DIDCommMessageMiddleware ¶
type DIDCommMessageMiddleware struct {
// contains filtered or unexported fields
}
DIDCommMessageMiddleware performs inbound/outbound message handling tasks that apply to all DIDComm V2 messages.
- Rotates DIDs on outbound messages, and handles inbound messages that rotate DIDs.
func New ¶
func New(p provider) (*DIDCommMessageMiddleware, error)
New creates a DIDCommMessageMiddleware.
func (*DIDCommMessageMiddleware) Create ¶
Create creates a didcomm/v2 DID rotation `from_prior`, as a compact-serialized JWS.
func (*DIDCommMessageMiddleware) HandleInboundMessage ¶
func (h *DIDCommMessageMiddleware) HandleInboundMessage( msg didcomm.DIDCommMsgMap, theirDID, myDID string, ) error
HandleInboundMessage processes did rotation and invitee connection creation on inbound messages.
func (*DIDCommMessageMiddleware) HandleInboundPeerDID ¶
func (h *DIDCommMessageMiddleware) HandleInboundPeerDID(msg didcomm.DIDCommMsgMap) error
HandleInboundPeerDID checks if an inbound message contains a peer DID, saving the peer DID if so.
func (*DIDCommMessageMiddleware) HandleOutboundMessage ¶
func (h *DIDCommMessageMiddleware) HandleOutboundMessage(msg didcomm.DIDCommMsgMap, rec *connection.Record, ) didcomm.DIDCommMsgMap
HandleOutboundMessage processes an outbound message.
func (*DIDCommMessageMiddleware) RotateConnectionDID ¶
func (h *DIDCommMessageMiddleware) RotateConnectionDID(connectionID, signingKID, newDID string) error
RotateConnectionDID rotates the agent's DID on the connection under connectionID.
func (*DIDCommMessageMiddleware) Verify ¶
func (h *DIDCommMessageMiddleware) Verify(senderDID, fromPrior string) (string, error)
Verify verifies a didcomm/v2 DID rotation.
- senderDID: the DID of the sender of the message containing this DID Rotation, known from the envelope or from the message's `to` field.
- fromPrior: the `from_prior` field of the rotated message.
Returns the sender's old DID (superseded by the new DID), if verification succeeds, or an error otherwise.