key

package
v0.0.0-...-f00139d Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ECDSA = iota
)

Variables

View Source
var (
	IllegalFormat = errors.New("illegal format")
	NoSuchKey     = errors.New("no such key")
	NoSuchKeyType = errors.New("no such key type")
)

Functions

This section is empty.

Types

type PrivateKey

type PrivateKey interface {
	Address() string
	PublicKey() PublicKey
	Type() Type

	Sign(hash []byte) ([]byte, error)

	PlainExport() ([]byte, error)
	SecureExport(passphrase string) ([]byte, error)
}

func NewPrivateKey

func NewPrivateKey(keyType Type) (PrivateKey, error)

func NewPrivateKeyFromEncryptedData

func NewPrivateKeyFromEncryptedData(keyType Type, payload []byte, passphrase string) (PrivateKey, error)

func NewPrivateKeyFromPlainData

func NewPrivateKeyFromPlainData(keyType Type, payload []byte) (PrivateKey, error)

type PublicKey

type PublicKey interface {
	Address() string
	Type() Type

	Verify(hash []byte, signature []byte) (bool, error)

	PlainExport() ([]byte, error)
}

func NewPublicKeyFromPlainData

func NewPublicKeyFromPlainData(keyType Type, payload []byte) (PublicKey, error)

type Type

type Type int

Jump to

Keyboard shortcuts

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