signature

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 2 Imported by: 19

Documentation

Overview

Package signature contains the cryptographic signature types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context string

Context is the chain domain separation context.

func DeriveChainContext

func DeriveChainContext(runtimeID common.Namespace, consensusChainContext string) Context

DeriveChainContext derives the chain domain separation context for a given runtime.

func (Context) New

func (c Context) New(base []byte) []byte

type PublicKey

type PublicKey interface {
	// String returns a string representation of the public key.
	String() string

	// Equal compares vs another public key for equality.
	Equal(other PublicKey) bool

	// Verify returns true iff the signature is valid for the public key over the context and
	// message.
	Verify(context, message, signature []byte) bool
}

PublicKey is a public key.

type Signer

type Signer interface {
	// Public returns the PublicKey corresponding to the signer.
	Public() PublicKey

	// ContextSign generates a signature with the private key over the context and
	// message.
	ContextSign(context, message []byte) ([]byte, error)

	// String returns the string representation of a Signer, which MUST not
	// include any sensitive information.
	String() string

	// Reset tears down the Signer and obliterates any sensitive state if any.
	Reset()
}

Signer is an opaque interface for private keys that is capable of producing signatures, in the spirit of `crypto.Signer`.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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