dummy

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ContractFormat = contract.SigningMeans("dummy")

ContractFormat is the contract format type

View Source
const NoSignatureType = "NoSignature"

NoSignatureType is a VerifiablePresentation Proof type where no signature is given

View Source
const SessionCompleted = "completed"

SessionCompleted represents the session state after the second SessionStatus call

View Source
const SessionCreated = "created"

SessionCreated represents the session state after creation

View Source
const SessionInProgress = "in-progress"

SessionInProgress represents the session state after the first SessionStatus call

View Source
const VerifiablePresentationType = contract.VPType("DummyVerifiablePresentation")

VerifiablePresentationType is the dummy verifiable presentation type

Variables

This section is empty.

Functions

This section is empty.

Types

type Dummy

type Dummy struct {
	InStrictMode bool
	Sessions     map[string]string
	Status       map[string]string
}

Dummy is a contract signer and verifier that always succeeds unless you try to use it in strict mode The dummy signer is not supposed to be used in a clustered context unless consecutive calls arrive at the same instance

func (Dummy) SigningSessionStatus

func (d Dummy) SigningSessionStatus(sessionID string) (contract.SigningSessionResult, error)

SigningSessionStatus looks up the session by the provided sessionID param. When the session exists it returns the current state and advances the state to the next one. When the session is SessionComplete, it removes the session from the sessionStore.

func (Dummy) StartSigningSession

func (d Dummy) StartSigningSession(rawContractText string) (contract.SessionPointer, error)

StartSigningSession starts a Dummy session. It takes any string and stores it under a random sessionID. This method is not available in strictMode returns the sessionPointer with the sessionID

func (Dummy) VerifyVP

func (d Dummy) VerifyVP(rawVerifiablePresentation []byte, checkTime *time.Time) (*contract.VPVerificationResult, error)

VerifyVP check a Dummy VerifiablePresentation. It Returns a verificationResult if all was fine, an error otherwise.

type Presentation

type Presentation struct {
	contract.VerifiablePresentationBase
	Proof Proof
}

Presentation is a VerifiablePresentation without valid cryptographic proofs It is only usable in non-strict mode.

type Proof

type Proof struct {
	// Proof type, mandatory
	Type string
	// Contract as how it was presented to the user
	Contract string
	// Initials form the signing means
	Initials string
	// Lastname form the signing means
	Lastname string
	// Birthdate form the signing means
	Birthdate string
	// Email form the signing means
	Email string
}

Proof holds the Proof generated from the dummy Signer

type SignedToken

type SignedToken struct {
	// contains filtered or unexported fields
}

SignedToken is the Dummy implementation of a Signed token. It can be used in the dummy.Service service.

func (SignedToken) Contract

func (d SignedToken) Contract() contract.Contract

Contract returns the contract

func (SignedToken) SignerAttributes

func (d SignedToken) SignerAttributes() (map[string]string, error)

SignerAttributes returns the attributes used to sign the token

Jump to

Keyboard shortcuts

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