sig

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash [32]byte

Hash is the result of Keccak256

func (Hash) Equal

func (hash Hash) Equal(other Hash) bool

Equal compares two `Hash`

func (*Hash) Read

func (hash *Hash) Read(r io.Reader) error

func (Hash) String

func (hash Hash) String() string

String prints the Hash as a Base64 encoded string.

func (Hash) Write

func (hash Hash) Write(w io.Writer) error

type Signatories

type Signatories []Signatory

Signatories is an array of Signatory

func (Signatories) Equal

func (sig Signatories) Equal(other Signatories) bool

Equal checks for set equality of Signatories, order does not matter

func (*Signatories) Read

func (sigs *Signatories) Read(r io.Reader) error

func (Signatories) Write

func (sigs Signatories) Write(w io.Writer) error

type Signatory

type Signatory [20]byte

Signatory is the last 20 bytes of a Public Key

func (Signatory) Equal

func (signatory Signatory) Equal(other Signatory) bool

Equal compares two `Signatory`

func (*Signatory) Read

func (sig *Signatory) Read(r io.Reader) error

func (Signatory) String

func (signatory Signatory) String() string

String prints the Signatory in a Base64 encoding.

func (Signatory) Write

func (sig Signatory) Write(w io.Writer) error

type Signature

type Signature [65]byte

Signature produced by `Sign`

func (Signature) Equal

func (sig Signature) Equal(other Signature) bool

Equal compares two `Signatory`

func (*Signature) Read

func (sig *Signature) Read(r io.Reader) error

func (Signature) Write

func (sig Signature) Write(w io.Writer) error

type Signatures

type Signatures []Signature

Signatures is an array of Signature

func (Signatures) Equal

func (sigs Signatures) Equal(other Signatures) bool

Equal checks for set equality of Signatures, order does not matter

func (*Signatures) Read

func (sigs *Signatures) Read(r io.Reader) error

func (Signatures) Write

func (sigs Signatures) Write(w io.Writer) error

type Signer

type Signer interface {
	// Sign a `Hash` and return the resulting `Signature`.
	Sign(hash Hash) (Signature, error)

	// Signatory returns the `Signatory` of your PublicKey
	Signatory() Signatory
}

Signer signs the provided hash, returning a signature

type SignerVerifier

type SignerVerifier interface {
	Signer
	Verifier
}

A SignerVerifier combines the `Signer` and `Verifier` interfaces.

type Verifier

type Verifier interface {
	// Note: Verify will not return an error if the hash and signature
	// do not match, but the returned public key is effectively random.
	Verify(hash Hash, signature Signature) (Signatory, error)
}

A Verifier can return the `Signatory` that produced a `Signature`.

Directories

Path Synopsis
Package ecdsa provides Sign and Verify capabilities using ECDSA I picked ethereum-go's implementation of ECDSA instead of the built in go libraries since it provides both build in marshaling/unmarshaling for the signature and a way to recover the Public Key from the signature.
Package ecdsa provides Sign and Verify capabilities using ECDSA I picked ethereum-go's implementation of ECDSA instead of the built in go libraries since it provides both build in marshaling/unmarshaling for the signature and a way to recover the Public Key from the signature.

Jump to

Keyboard shortcuts

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