key

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	Address *address.Address
	// contains filtered or unexported fields
}

Key represents a asymmetric encryption pair of private key and public key

func NewFromPrivKeyHex

func NewFromPrivKeyHex(hexStr string, mode types.Mode) (*Key, error)

NewFromPrivKeyHex creates and returns a new Key depends on the given private 0x prefixed hex string and mode using secp256k1

func (*Key) Sign

func (key *Key) Sign(hexStr string) (*types.HexStr, error)

Sign signs data of decoding from the given hexStr using the private key

func (*Key) SignRecoverableFor32Bytes

func (key *Key) SignRecoverableFor32Bytes(data []byte) (*types.HexStr, error)

func (*Key) SignRecoverableFor32BytesHex

func (key *Key) SignRecoverableFor32BytesHex(hex32BytesStr string) (*types.HexStr, error)

SignRecoverableFor32BytesHex signs the data of decoding from the given hex32BytesStr using the private key in recoverable mode

Jump to

Keyboard shortcuts

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