gecdsa

package
v0.0.0-...-bad6181 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BitcoinKeyFmt *bitcoinKeyFmt
)

Functions

func LoadPrivateKeyFromBytes

func LoadPrivateKeyFromBytes(privateKeyBytes []byte) (*ecdsa.PrivateKey, error)

Types

type Ecdsa

type Ecdsa interface {
	PrivateKeyToPublicKey(privateKey Key) (publicKey Key, err error)
	PublicKeyToAddress(publicKey Key) (addr Key, err error)
	Sign(privateKey Key, originData []byte) (sign *Signature, err error)
	Verify(publicKey Key, originData []byte, sign *Signature) (bool, error)
}

type Key

type Key []byte

func NewKey

func NewKey(key []byte) Key

func (Key) Bytes

func (dk Key) Bytes() []byte

func (Key) String

func (dk Key) String(kf gcryptfmt.KeyEncode) (string, error)

type KeyPair

type KeyPair struct {
	PrivateKey Key
	PublicKey  Key
}

func PrivateKeyToKeyPair

func PrivateKeyToKeyPair(key *ecdsa.PrivateKey) (*KeyPair, error)

type Signature

type Signature struct {
	Data []byte
}

func (*Signature) Bytes

func (s *Signature) Bytes() []byte

func (*Signature) String

func (s *Signature) String() string

Jump to

Keyboard shortcuts

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