Documentation ¶
Index ¶
- func AddBasicMessageRep(p *BasicMessageRep) (err error)
- func AddIssueCredRep(p *IssueCredRep) (err error)
- func AddPSM(p *PSM) (err error)
- func AddPairwiseRep(p *PairwiseRep) (err error)
- func AddPresentProofRep(p *PresentProofRep) (err error)
- func AddRawPL(addr *endp.Addr, data []byte) (err error)
- func Open(filename string) (err error)
- func RmPSM(p *PSM) (err error)
- func RmRawPL(addr *endp.Addr) (err error)
- type BasicMessageRep
- type DIDRep
- type IssueCredRep
- func (rep *IssueCredRep) BuildCredRequest(packet comm.Packet) (cr string, err error)
- func (rep *IssueCredRep) Data() []byte
- func (rep *IssueCredRep) IssuerBuildCred(packet comm.Packet, credReq string) (c string, err error)
- func (rep *IssueCredRep) KData() []byte
- func (rep *IssueCredRep) StoreCred(packet comm.Packet, cred string) error
- type PSM
- func (p *PSM) Data() []byte
- func (p *PSM) FirstState() *State
- func (p *PSM) IsReady() bool
- func (p *PSM) LastState() *State
- func (p *PSM) Next() string
- func (p *PSM) PairwiseName() string
- func (p *PSM) PendingUserAction() bool
- func (p *PSM) PresentTask() (t comm.Task)
- func (p *PSM) Protocol() string
- func (p *PSM) Timestamp() int64
- type PairwiseRep
- type PayloadInfo
- type PresentProofRep
- type State
- type StateKey
- type SubState
- type WalletRep
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddBasicMessageRep ¶
func AddBasicMessageRep(p *BasicMessageRep) (err error)
func AddIssueCredRep ¶
func AddIssueCredRep(p *IssueCredRep) (err error)
func AddPairwiseRep ¶
func AddPairwiseRep(p *PairwiseRep) (err error)
func AddPresentProofRep ¶
func AddPresentProofRep(p *PresentProofRep) (err error)
Types ¶
type BasicMessageRep ¶
type BasicMessageRep struct { Key StateKey PwName string Message string SendTimestamp int64 Timestamp int64 SentByMe bool Delivered bool }
func GetBasicMessageRep ¶
func GetBasicMessageRep(k StateKey) (m *BasicMessageRep, err error)
func NewBasicMessageRep ¶
func NewBasicMessageRep(d []byte) *BasicMessageRep
func (*BasicMessageRep) Data ¶
func (p *BasicMessageRep) Data() []byte
func (*BasicMessageRep) KData ¶
func (p *BasicMessageRep) KData() []byte
type IssueCredRep ¶
type IssueCredRep struct { Key StateKey Timestamp int64 CredDefID string CredDef string CredOffer string CredReqMeta string Values string Attributes []didcomm.CredentialAttribute }
func GetIssueCredRep ¶
func GetIssueCredRep(k StateKey) (m *IssueCredRep, err error)
func NewIssueCredRep ¶
func NewIssueCredRep(d []byte) *IssueCredRep
func (*IssueCredRep) BuildCredRequest ¶
func (rep *IssueCredRep) BuildCredRequest(packet comm.Packet) (cr string, err error)
BuildCredRequest builds credential request which is PROVER/HOLDER SIDE action.
func (*IssueCredRep) Data ¶
func (rep *IssueCredRep) Data() []byte
func (*IssueCredRep) IssuerBuildCred ¶
IssuerBuildCred builds credentials in -- ISSUER SIDE --. Note! values are needed here!!
func (*IssueCredRep) KData ¶
func (rep *IssueCredRep) KData() []byte
type PSM ¶
type PSM struct { // Key is the primary key of the protocol state machine: it's pointed by // CA's DID and the current connection ID Key StateKey // StartedByUs tells if Our CA is the one who sent the first protocol msg. // It' false if we are the receving part. Please note that Role is a // protocol specific and not directly correlate with StartedByUs flag. StartedByUs bool // Role is a protocol role in the current DID protocol Role pb.Protocol_Role // ConnDID stores our end's pairwise/connection DID. Please note that the // connection ID can be found from Key. ConnDID string // States has all ouf the state history of this PSM in timestamp order States []State }
PSM is Protocol State Machine that works in event sourcing principle, i.e. every state transition is saved to its State field. Other fields are calculated ASAP and kept that way until to the end.
func FindPSM ¶ added in v0.25.7
FindPSM doesn't return error if the PSM doesn't exist. Instead the returned PSM is nil.
func GetPSM ¶
GetPSM get existing PSM from DB. If the PSM doesn't exist it returns error. See FindPSM for version which doesn't return error if the PSM doesn't exist.
func (*PSM) FirstState ¶
func (*PSM) Next ¶
Next is for getting the upcoming protocol message type. For example, if we are waiting a certain message from other end, we can check the message type with this function.
func (*PSM) PairwiseName ¶
func (*PSM) PendingUserAction ¶
PendingUserAction returns true if we the PSM is waiting an user action msg.
func (*PSM) PresentTask ¶ added in v0.25.8
PresentTask returns latest state's Task of the PSM.
type PairwiseRep ¶
type PairwiseRep struct { Name string // In our implementation this is connection id! Key StateKey TheirLabel string Caller DIDRep Callee DIDRep }
func GetPairwiseRep ¶
func GetPairwiseRep(k StateKey) (m *PairwiseRep, err error)
func NewPairwiseRep ¶
func NewPairwiseRep(d []byte) *PairwiseRep
func (*PairwiseRep) Data ¶
func (p *PairwiseRep) Data() []byte
func (*PairwiseRep) KData ¶
func (p *PairwiseRep) KData() []byte
type PayloadInfo ¶
type PayloadInfo struct {
Type string
}
type PresentProofRep ¶
type PresentProofRep struct { Key StateKey ProofReq string Proof string Values string // currently only used for Task API to get data WeProposed bool Attributes []didcomm.ProofAttribute }
func GetPresentProofRep ¶
func GetPresentProofRep(k StateKey) (m *PresentProofRep, err error)
func NewPresentProofRep ¶
func NewPresentProofRep(d []byte) *PresentProofRep
func (*PresentProofRep) CreateProof ¶
func (rep *PresentProofRep) CreateProof(packet comm.Packet, rootDID string) (err error)
CreateProof is PROVER side helper.
func (*PresentProofRep) Data ¶
func (rep *PresentProofRep) Data() []byte
func (*PresentProofRep) KData ¶
func (rep *PresentProofRep) KData() []byte
func (*PresentProofRep) VerifyProof ¶
func (rep *PresentProofRep) VerifyProof(packet comm.Packet) (ack bool, err error)
type State ¶
type State struct { Timestamp int64 T comm.Task PLInfo PayloadInfo Sub SubState }
todo: new idea StateEvent, rename atleast T
type SubState ¶
type SubState uint // TODO: rename State or StateType
SubState is enumeration for the state transitions PSM will have during its execution. The above PUML diagram illustrates what transitions are currently recognized. The Ready state should have 2 internal states: ACK/NACK