issuecredential

package
v0.30.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package issuecredential is package for Aries protocol messages for same name.

Index

Constants

This section is empty.

Variables

View Source
var IssueCreator = &IssueFactor{}
View Source
var OfferCreator = &OfferFactor{}
View Source
var ProposeCreator = &ProposeFactor{}
View Source
var RequestCreator = &RequestFactor{}

Functions

func CredentialAttach

func CredentialAttach(p *Issue) (data []byte, err error)

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 OfferAttach(p *Offer) (data []byte, err error)

func PreviewCredentialToCodedValues

func PreviewCredentialToCodedValues(credential PreviewCredential) string

func PreviewCredentialToValues

func PreviewCredentialToValues(credential PreviewCredential) string

func RequestAttach

func RequestAttach(p *Request) (data []byte, err error)

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 IssueImpl

type IssueImpl struct {
	*Issue
}

MARK: Struct

func NewIssue

func NewIssue(r *Issue) *IssueImpl

func NewIssueMsg

func NewIssueMsg(data []byte) *IssueImpl

func (*IssueImpl) FieldObj

func (p *IssueImpl) FieldObj() interface{}

func (*IssueImpl) ID

func (p *IssueImpl) ID() string

func (*IssueImpl) JSON

func (p *IssueImpl) JSON() []byte

func (*IssueImpl) SetID

func (p *IssueImpl) SetID(id string)

func (*IssueImpl) SetType

func (p *IssueImpl) SetType(t string)

func (*IssueImpl) Thread

func (p *IssueImpl) Thread() *decorator.Thread

func (*IssueImpl) Type

func (p *IssueImpl) Type() string

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 OfferImpl

type OfferImpl struct {
	*Offer
}

MARK: Struct

func NewOffer

func NewOffer(r *Offer) *OfferImpl

func NewOfferMsg

func NewOfferMsg(data []byte) *OfferImpl

func (*OfferImpl) FieldObj

func (p *OfferImpl) FieldObj() interface{}

func (*OfferImpl) ID

func (p *OfferImpl) ID() string

func (*OfferImpl) JSON

func (p *OfferImpl) JSON() []byte

func (*OfferImpl) SetID

func (p *OfferImpl) SetID(id string)

func (*OfferImpl) SetType

func (p *OfferImpl) SetType(t string)

func (*OfferImpl) Thread

func (p *OfferImpl) Thread() *decorator.Thread

func (*OfferImpl) Type

func (p *OfferImpl) Type() string

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

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL