ethereum

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EEngine

type EEngine struct {
	// contains filtered or unexported fields
}

EEngine is the engine of ETH

func New

func New() *EEngine

New create new EEngine

func (EEngine) DecryptKey

func (e EEngine) DecryptKey(keyJSON []byte, pass string) (*crypto.PrivateKey, *crypto.PublicKey, error)

DecryptKey decrypt private key from file

func (EEngine) EncryptKey

func (e EEngine) EncryptKey(priKey *crypto.PrivateKey, pass string) ([]byte, error)

EncryptKey encryptKey into file

func (EEngine) GenKey

func (e EEngine) GenKey(params ...interface{}) (*crypto.PrivateKey, *crypto.PublicKey, error)

GenKey generate the private and public key pair

func (EEngine) MappingKey

func (e EEngine) MappingKey(privKey *crypto.PrivateKey, pubKey *crypto.PublicKey) (map[string]interface{}, map[string]interface{}, error)

MappingKey build private & public key content into map for display or marshal

func (EEngine) Marshal

func (e EEngine) Marshal(privKey *crypto.PrivateKey, pubKey *crypto.PublicKey) ([]byte, []byte, error)

Marshal marshal private & public key to json

func (EEngine) Name

func (e EEngine) Name() string

Name return the name of this engine (ETH)

func (EEngine) Sign

func (e EEngine) Sign(hash []byte, priKey *crypto.PrivateKey) (*crypto.Signature, error)

Sign is used to create signature of content by private key

func (EEngine) Unmarshal

func (e EEngine) Unmarshal(privKeyBytes, pubKeyBytes []byte) (privKey *crypto.PrivateKey, pubKey *crypto.PublicKey, err error)

Unmarshal unmarshal private & public key from json

func (EEngine) Verify

func (e EEngine) Verify(hash []byte, sig *crypto.Signature) (bool, error)

Verify is used to verify the signature

Jump to

Keyboard shortcuts

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