bitcoin

package
Version: 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 BEngine

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

BEngine is the engine of BTC

func New

func New() *BEngine

New create new BEngine

func (BEngine) DecryptKey

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

DecryptKey decrypt private key from file

func (BEngine) EncryptKey

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

EncryptKey encryptKey into file

func (BEngine) GenKey

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

GenKey generate the private and public key pair

func (BEngine) MappingKey

func (e BEngine) 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 (BEngine) Marshal

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

Marshal marshal private & public key

func (BEngine) Name

func (e BEngine) Name() string

Name return the name of this engine (BTC)

func (BEngine) Sign

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

Sign is used to create signature of content by private key

func (BEngine) Unmarshal

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

Unmarshal unmarshal private & public key

func (BEngine) Verify

func (e BEngine) 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