presentproof

package
v0.31.13 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Creator = &Factor{}
View Source
var PresentationCreator = &PresentationFactor{}
View Source
var RequestCreator = &RequestFactor{}

Functions

func NewPresentationAttach

func NewPresentationAttach(ID string, proofReq []byte) []decorator.Attachment

func NewRequestPresentation

func NewRequestPresentation(ID string, proofReq []byte) []decorator.Attachment

func Proof

func Proof(p *Presentation) (data []byte, err error)

func ProofReq

func ProofReq(req *Request) (pr map[string]interface{}, err error)

func ProofReqData

func ProofReqData(req *Request) (data []byte, err error)

Types

type Attribute

type Attribute struct {
	Name      string `json:"name"`
	CredDefID string `json:"cred_def_id,omitempty"`

	// https://github.com/hyperledger/aries-rfcs/blob/master/features/0037-present-proof/README.md#mime-type-and-value
	MimeType string `json:"mime_type,omitempty"`
	Value    string `json:"value,omitempty"`

	// https://github.com/hyperledger/aries-rfcs/blob/master/features/0037-present-proof/README.md#referent
	Referent string `json:"referent,omitempty"`
}

type Factor

type Factor struct{}

func (*Factor) NewMessage

func (f *Factor) NewMessage(data []byte) didcomm.MessageHdr

func (*Factor) NewMsg

func (f *Factor) NewMsg(init didcomm.MsgInit) didcomm.MessageHdr

type Predicate

type Predicate struct {
	Name      string `json:"name"`
	CredDefID string `json:"cred_def_id"`
	Predicate string `json:"predicate"` // "<", "<=", ">=", ">"
	Threshold string `json:"threshold"`
}

Predicate is definition type of Preview struct.

https://github.com/hyperledger/aries-rfcs/blob/master/features/0037-present-proof/README.md#predicates

type Presentation

type Presentation struct {
	Type                 string                 `json:"@type,omitempty"`
	ID                   string                 `json:"@id,omitempty"`
	Comment              string                 `json:"comment,omitempty"`
	PresentationAttaches []decorator.Attachment `json:"presentations~attach,omitempty"`
	Thread               *decorator.Thread      `json:"~thread,omitempty"`
}

type PresentationFactor

type PresentationFactor struct{}

func (*PresentationFactor) NewMessage

func (f *PresentationFactor) NewMessage(data []byte) didcomm.MessageHdr

func (*PresentationFactor) NewMsg

type PresentationImpl

type PresentationImpl struct {
	*Presentation
}

MARK: Struct

func NewPresentation

func NewPresentation(r *Presentation) *PresentationImpl

func NewPresentationMsg

func NewPresentationMsg(data []byte) *PresentationImpl

func (*PresentationImpl) FieldObj

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

func (*PresentationImpl) ID

func (p *PresentationImpl) ID() string

func (*PresentationImpl) JSON

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

func (*PresentationImpl) SetID

func (p *PresentationImpl) SetID(id string)

func (*PresentationImpl) SetType

func (p *PresentationImpl) SetType(t string)

func (*PresentationImpl) Thread

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

func (*PresentationImpl) Type

func (p *PresentationImpl) Type() string

type Preview

type Preview struct {
	Type       string      `json:"@type,omitempty"`
	Attributes []Attribute `json:"attributes"`
	Predicates []Predicate `json:"predicates"`
}

func NewPreview

func NewPreview(values []string, credDefID string) *Preview

todo: currently only used with the previous and in tests! This will be important later.

func NewPreviewWithAttributes added in v0.24.21

func NewPreviewWithAttributes(attrs []Attribute) *Preview

type Propose

type Propose struct {
	Type                 string            `json:"@type,omitempty"`
	ID                   string            `json:"@id,omitempty"`
	Comment              string            `json:"comment,omitempty"`
	PresentationProposal *Preview          `json:"presentation_proposal,omitempty"`
	Thread               *decorator.Thread `json:"~thread,omitempty"`
}

type ProposeImpl

type ProposeImpl struct {
	*Propose
}

func NewMsg

func NewMsg(data []byte) *ProposeImpl

func NewPropose

func NewPropose(r *Propose) *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 {
	Type                 string                 `json:"@type,omitempty"`
	ID                   string                 `json:"@id,omitempty"`
	Comment              string                 `json:"comment,omitempty"`
	RequestPresentations []decorator.Attachment `json:"request_presentations~attach,omitempty"`
	Thread               *decorator.Thread      `json:"~thread,omitempty"`
}

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
}

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