key

package
v0.0.0-...-3b62c27 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPubKeyHash

func ExtractPubKeyHash(address string) []byte

ExtractPubKeyHash will pull the public key hash out of a wallet address.

func GenKey

func GenKey() *ecdsa.PrivateKey

GenKey will genrate a private key

func GenPair

func GenPair() ([]byte, *ecdsa.PrivateKey)

GenPair generates a public key and private key pair

func HashECDSAPubKey

func HashECDSAPubKey(pub *ecdsa.PublicKey) []byte

func HashPubKey

func HashPubKey(pub crypto.PubKey) []byte

HashPubKey will create a public key hash from a public key.

func UnmarshalPubKey

func UnmarshalPubKey(b []byte) (*ecdsa.PublicKey, error)

Types

type Address

type Address interface {
	Address() string

	PubKeyHash() []byte
}

Address defines an interface for objects that hold an address

type PubKey

type PubKey []byte

PubKey is a public key

func (PubKey) Bytes

func (pk PubKey) Bytes() ([]byte, error)

func (PubKey) Hash

func (pk PubKey) Hash() []byte

Hash will generate the public key hash.

func (PubKey) Raw

func (pk PubKey) Raw() ([]byte, error)

type Receiver

type Receiver = Address

Receiver defines an interface for objects that are able to receive the contents of a transaction This is only for smooth naming.

func NewReceiver

func NewReceiver(addr string) Receiver

NewReceiver creates a receiver type

type Sender

type Sender interface {
	Receiver
	PrivateKey() *ecdsa.PrivateKey
	PublicKey() []byte
}

Sender defines an interface for somthing that can send values through a transaction. This should be analogous to the current user.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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