keypair

package
v0.0.0-...-c4e539a Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NISTP256Version = iota
	Ed25519Version
	WIFVersion = 0x80
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addressable

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

func NewAddressable

func NewAddressable(address string) *Addressable

func (*Addressable) GetAddress

func (aa *Addressable) GetAddress() string

func (*Addressable) GetBin

func (aa *Addressable) GetBin() []byte

func (*Addressable) GetPublicKey

func (aa *Addressable) GetPublicKey() []byte

type Keypair

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

func New

func New(version int) *Keypair

func NewKeypairFromHex

func NewKeypairFromHex(version int, privHex string) *Keypair

func (*Keypair) CreateAddress

func (kp *Keypair) CreateAddress(publicKey []byte) string

CreateAddress first byte 0, second byte is network | keyType, next is public key and then base64 for all

func (*Keypair) CreateAddressable

func (kp *Keypair) CreateAddressable() *Addressable

func (*Keypair) CreatePublicFromPrivate

func (kp *Keypair) CreatePublicFromPrivate(private string) string

func (*Keypair) GenerateKey

func (kp *Keypair) GenerateKey() ([]byte, []byte)

func (*Keypair) SetPrivateKey

func (kp *Keypair) SetPrivateKey(privateKey []byte)

func (*Keypair) Sign

func (kp *Keypair) Sign(message []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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