Documentation ¶
Overview ¶
Package issuecredential is package for Aries protocol messages for same name.
Index ¶
- Variables
- func CredentialAttach(p *Issue) (data []byte, err error)
- func NewCredentialsAttach(attach []byte) []decorator.Attachment
- func NewOfferAttach(offer []byte) []decorator.Attachment
- func NewRequestAttach(attach []byte) []decorator.Attachment
- func OfferAttach(p *Offer) (data []byte, err error)
- func PreviewCredentialToCodedValues(credential PreviewCredential) string
- func PreviewCredentialToValues(credential PreviewCredential) string
- func RequestAttach(p *Request) (data []byte, err error)
- type Attribute
- type Issue
- type IssueFactor
- type IssueImpl
- type Offer
- type OfferFactor
- type OfferImpl
- type PreviewCredential
- type Propose
- type ProposeFactor
- type ProposeImpl
- type Request
- type RequestFactor
- type RequestImpl
Constants ¶
This section is empty.
Variables ¶
var IssueCreator = &IssueFactor{}
var OfferCreator = &OfferFactor{}
var ProposeCreator = &ProposeFactor{}
var RequestCreator = &RequestFactor{}
Functions ¶
func CredentialAttach ¶
func NewCredentialsAttach ¶
func NewCredentialsAttach(attach []byte) []decorator.Attachment
func NewOfferAttach ¶
func NewOfferAttach(offer []byte) []decorator.Attachment
func NewRequestAttach ¶
func NewRequestAttach(attach []byte) []decorator.Attachment
func OfferAttach ¶
func PreviewCredentialToCodedValues ¶
func PreviewCredentialToCodedValues(credential PreviewCredential) string
func PreviewCredentialToValues ¶
func PreviewCredentialToValues(credential PreviewCredential) string
func RequestAttach ¶
Types ¶
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 Issue ¶
type Issue struct { ID string `json:"@id,omitempty"` 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"` // CredentialsAttach is a slice of attachments containing the issued credentials. CredentialsAttach []decorator.Attachment `json:"credentials~attach,omitempty"` Thread *decorator.Thread `json:"~thread,omitempty"` }
Issue contains as attached payload the credentials being issued and is sent in response to a valid Request Credential message. TODO: Need to add ~please-ack decorator [Issue #1299]
type IssueFactor ¶
type IssueFactor struct{}
func (*IssueFactor) NewMessage ¶
func (f *IssueFactor) NewMessage(data []byte) didcomm.MessageHdr
func (*IssueFactor) NewMsg ¶
func (f *IssueFactor) NewMsg(init didcomm.MsgInit) didcomm.MessageHdr
type Offer ¶
type Offer struct { ID string `json:"@id,omitempty"` 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"` // 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"` Thread *decorator.Thread `json:"~thread,omitempty"` }
Offer 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 OfferFactor ¶
type OfferFactor struct{}
func (*OfferFactor) NewMessage ¶
func (f *OfferFactor) NewMessage(data []byte) didcomm.MessageHdr
func (*OfferFactor) NewMsg ¶
func (f *OfferFactor) NewMsg(init didcomm.MsgInit) didcomm.MessageHdr
type PreviewCredential ¶
type PreviewCredential struct { Type string `json:"@type,omitempty"` Attributes []Attribute `json:"attributes,omitempty"` }
Preview is used to construct a preview of the data for the credential that is to be issued.
func NewPreviewCredential ¶
func NewPreviewCredential(values string) PreviewCredential
NewPreviewCredential creates a new PreviewCredential from JSON array which includes Attributes as Name Value pairs.
func NewPreviewCredentialRaw ¶
func NewPreviewCredentialRaw(values string) PreviewCredential
NewPreviewCredentialRaw creates a new PreviewCredential from JSON array which includes anoncreds.CredDefAttrs. NOTE! this is obsolete: for legacy protocol.
type Propose ¶
type Propose struct { ID string `json:"@id,omitempty"` 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"` // SchemaIssuerDid is an optional filter to request credential based on a particular Schema issuer DID. SchemaIssuerDid string `json:"schema_issuer_did,omitempty"` // SchemaID is an optional filter to request credential based on a particular Schema. // This might be helpful when requesting a version 1 passport instead of a version 2 passport, for example. SchemaID string `json:"schema_id,omitempty"` // SchemaName is an optional filter to request credential based on a schema name. // This is useful to allow a more user-friendly experience of requesting a credential by schema name. SchemaName string `json:"schema_name,omitempty"` // SchemaVersion is an optional filter to request credential based on a schema version. // This is useful to allow a more user-friendly experience of requesting a credential by schema name and version. SchemaVersion string `json:"schema_version,omitempty"` // CredDefID is an optional filter to request credential based on a particular Credential Definition. // This might be helpful when requesting a commercial driver's license instead of // an ordinary driver's license, for example. CredDefID string `json:"cred_def_id,omitempty"` // IssuerDid is an optional filter to request a credential issued by the owner of a particular DID. IssuerDid string `json:"issuer_did,omitempty"` Thread *decorator.Thread `json:"~thread,omitempty"` }
Propose 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 ProposeFactor ¶
type ProposeFactor struct{}
func (*ProposeFactor) NewMessage ¶
func (f *ProposeFactor) NewMessage(data []byte) didcomm.MessageHdr
func (*ProposeFactor) NewMsg ¶
func (f *ProposeFactor) NewMsg(init didcomm.MsgInit) didcomm.MessageHdr
type ProposeImpl ¶
type ProposeImpl struct {
*Propose
}
MARK: Struct
func NewPropose ¶
func NewPropose(r *Propose) *ProposeImpl
func NewProposeMsg ¶
func NewProposeMsg(data []byte) *ProposeImpl
func (*ProposeImpl) FieldObj ¶
func (p *ProposeImpl) FieldObj() interface{}
func (*ProposeImpl) ID ¶
func (p *ProposeImpl) ID() string
func (*ProposeImpl) JSON ¶
func (p *ProposeImpl) JSON() []byte
func (*ProposeImpl) SetID ¶
func (p *ProposeImpl) SetID(id string)
func (*ProposeImpl) SetType ¶
func (p *ProposeImpl) SetType(t string)
func (*ProposeImpl) Thread ¶
func (p *ProposeImpl) Thread() *decorator.Thread
func (*ProposeImpl) Type ¶
func (p *ProposeImpl) Type() string
type Request ¶
type Request struct { ID string `json:"@id,omitempty"` 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"` // RequestsAttach is a slice of attachments defining the requested formats for the credential RequestsAttach []decorator.Attachment `json:"requests~attach,omitempty"` Thread *decorator.Thread `json:"~thread,omitempty"` }
Request 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 RequestFactor ¶
type RequestFactor struct{}
func (*RequestFactor) NewMessage ¶
func (f *RequestFactor) NewMessage(data []byte) didcomm.MessageHdr
func (*RequestFactor) NewMsg ¶
func (f *RequestFactor) NewMsg(init didcomm.MsgInit) didcomm.MessageHdr
type RequestImpl ¶
type RequestImpl struct {
*Request
}
MARK: Struct
func NewRequest ¶
func NewRequest(r *Request) *RequestImpl
func NewRequestMsg ¶
func NewRequestMsg(data []byte) *RequestImpl
func (*RequestImpl) FieldObj ¶
func (p *RequestImpl) FieldObj() interface{}
func (*RequestImpl) ID ¶
func (p *RequestImpl) ID() string
func (*RequestImpl) JSON ¶
func (p *RequestImpl) JSON() []byte
func (*RequestImpl) SetID ¶
func (p *RequestImpl) SetID(id string)
func (*RequestImpl) SetType ¶
func (p *RequestImpl) SetType(t string)
func (*RequestImpl) Thread ¶
func (p *RequestImpl) Thread() *decorator.Thread
func (*RequestImpl) Type ¶
func (p *RequestImpl) Type() string