crypto

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: LGPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicAddressToByteArray added in v0.2.0

func PublicAddressToByteArray(add common.Address) []byte

PublicAddressToByteArray returns []byte address for given PublicKey Address

Types

type KeyType

type KeyType = string

KeyType str

const Ed25519Type KeyType = "ed25519"

Ed25519Type ed25519

const Secp256k1Type KeyType = "secp256k1"

Secp256k1Type secp256k1

const Sr25519Type KeyType = "sr25519"

Sr25519Type sr25519

const UnknownType KeyType = "unknown"

UnknownType is used by the GenericKeystore

type Keypair

type Keypair interface {
	Type() KeyType
	Sign(msg []byte) ([]byte, error)
	Public() PublicKey
	Private() PrivateKey
}

Keypair interface

type PrivateKey

type PrivateKey interface {
	Sign(msg []byte) ([]byte, error)
	Public() (PublicKey, error)
	Encode() []byte
	Decode([]byte) error
	Hex() string
}

PrivateKey interface

type PublicKey

type PublicKey interface {
	Verify(msg, sig []byte) (bool, error)
	Encode() []byte
	Decode([]byte) error
	Address() common.Address
	Hex() string
}

PublicKey interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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