proof

package
v0.0.0-...-d3ca5b1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	JCSVerificationType = "Ed25519VerificationKey2018"
	JCSSignatureType    = "JcsEd25519Signature2020"
)

Variables

This section is empty.

Functions

func GenericSign

func GenericSign(provable Provable, privKey ed25519.PrivateKey) ([]byte, error)

func VerifyEd25519Proof

func VerifyEd25519Proof(provable Provable, pubKey ed25519.PublicKey) error

Types

type Proof

type Proof struct {
	Created            string `json:"created,omitempty"`
	VerificationMethod string `json:"verificationMethod,omitempty"`
	Nonce              string `json:"nonce,omitempty"`
	SignatureValue     string `json:"signatureValue,omitempty"`
	Type               string `json:"type,omitempty"`
}

Proof a signed proof of a given ledger document

func CreateEd25519Proof

func CreateEd25519Proof(provable Provable, privKey ed25519.PrivateKey, fullyQualifiedKeyRef, nonce string) (*Proof, error)

func CreateEd25519ProofOptions

func CreateEd25519ProofOptions(provable Provable, privKey ed25519.PrivateKey, opts ProofOptions) (*Proof, error)

type ProofOptions

type ProofOptions struct {
	Created            bool
	VerificationMethod string
	Nonce              string
}

type Provable

type Provable interface {
	GetProof() *Proof
	SetProof(p Proof)
}

Jump to

Keyboard shortcuts

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