entity

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	Age            int    `json:"age"`
	UniversityName string `json:"universityName"`
	Degree         string `json:"degree"`
}

func (Claim) GetType

func (c Claim) GetType() []string

type Credential

type Credential struct {
	CredentialToSign

	Proof Proof `json:"proof"`
}

func (Credential) Export

func (c Credential) Export() (buf []byte, err error)

type CredentialSubject

type CredentialSubject struct {
	ID    []byte `json:"id"`
	Claim Claim  `json:"claim"`
}

type CredentialToSign

type CredentialToSign struct {
	Context           []string          `json:"context"`
	TypeOfCredential  []string          `json:"type"`
	IssuanceDate      time.Time         `json:"issuanceDate"`
	CredentialSubject CredentialSubject `json:"credentialSubject"`
}

func UnmarshalCredential

func UnmarshalCredential(b []byte) (*CredentialToSign, error)

type KeyPair

type KeyPair struct {
	PublicKey  crypto.PublicKey
	PrivateKey crypto.PrivateKey
}

type Presentation

type Presentation struct {
	PresentationToSign

	Proof Proof `json:"proof"`
}

func (Presentation) Export

func (p Presentation) Export() (buf []byte, err error)

type PresentationToSign

type PresentationToSign struct {
	Context            []string   `json:"context"`
	TypeOfPresentation []string   `json:"type"`
	Credential         Credential `json:"credential"`
	Nonce              []byte     `json:"nonce"`
}

type Proof

type Proof struct {
	TypeOfProof string           `json:"type"`
	Created     time.Time        `json:"created"`
	Creator     crypto.PublicKey `json:"creator"`
	Signature   []byte           `json:"signature"`
}

func SignProofIssuer

func SignProofIssuer(keys KeyPair, docToSign []byte) (Proof, error)

type RawSignature

type RawSignature struct {
	R, S *big.Int
}

Jump to

Keyboard shortcuts

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