key

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 16 Imported by: 0

README

The sign code is taken from https://github.com/asuleymanov/rpc/tree/master/transactions with some adoptions

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongPrefix   = errors.New("wrong prefix")
	ErrWrongChecksum = errors.New("wrong check sum")
	ErrWrongKeyLen   = errors.New("wrong key len")
	ErrKeyMismatch   = errors.New("key mismatch")
)

Functions

func SignBufferSha256

func SignBufferSha256(bufSha256 []byte, privateKey *ecdsa.PrivateKey) []byte

Types

type PrivateKey

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

func NewPrivateKey

func NewPrivateKey() (*PrivateKey, error)

func PrivateKeyFromBytes

func PrivateKeyFromBytes(privKey []byte) (*PrivateKey, error)

func PrivateKeyFromString

func PrivateKeyFromString(wif string) (*PrivateKey, error)

func (*PrivateKey) PublicKey

func (p *PrivateKey) PublicKey() *PublicKey

func (*PrivateKey) Serialize

func (p *PrivateKey) Serialize() []byte

func (*PrivateKey) Sign

func (p *PrivateKey) Sign(hash []byte) []byte

func (*PrivateKey) String

func (p *PrivateKey) String() string

type PublicKey

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

func NewPublicKey

func NewPublicKey(pubKey string) (*PublicKey, error)

func PublicKeyFromBytes

func PublicKeyFromBytes(key []byte) (*PublicKey, error)

func (*PublicKey) MarshalTransaction

func (p *PublicKey) MarshalTransaction(encoder *transaction.Encoder) error

func (*PublicKey) Serialize

func (p *PublicKey) Serialize() []byte

func (*PublicKey) String

func (p *PublicKey) String() string

func (*PublicKey) Verify

func (p *PublicKey) Verify(digest []byte, signature []byte) error

Directories

Path Synopsis
Package rfc6979 is an implementation of RFC 6979's deterministic DSA.
Package rfc6979 is an implementation of RFC 6979's deterministic DSA.

Jump to

Keyboard shortcuts

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