starkkey

package
v1.6.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PubToStarkKey

func PubToStarkKey(pubkey starksig.PublicKey) []byte

PubToStarkKey implements the pubkey to starkkey functionality: https://github.com/0xs34n/starknet.js/blob/cd61356974d355aa42f07a3d63f7ccefecbd913c/src/utils/ellipticCurve.ts#L49

Types

type Key

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

Key represents StarkNet key

func FromEncryptedJSON

func FromEncryptedJSON(keyJSON []byte, password string) (Key, error)

FromEncryptedJSON gets key from json and password

func MustNewInsecure

func MustNewInsecure(reader io.Reader) Key

MustNewInsecure return Key if no error

func New

func New() (Key, error)

New creates new Key

func (Key) GoString

func (key Key) GoString() string

GoString wraps String()

func (Key) ID

func (key Key) ID() string

ID gets Key ID

func (Key) PublicKey

func (key Key) PublicKey() starksig.PublicKey

PublicKey copies public key object

func (Key) PublicKeyStr

func (key Key) PublicKeyStr() string

PublicKeyStr

func (Key) Raw

func (key Key) Raw() Raw

Raw from private key

func (Key) String

func (key Key) String() string

String is the print-friendly format of the Key

func (Key) ToEncryptedJSON

func (key Key) ToEncryptedJSON(password string, scryptParams utils.ScryptParams) (export []byte, err error)

ToEncryptedJSON returns encrypted JSON representing key

func (Key) ToPrivKey

func (key Key) ToPrivKey() starksig.PrivateKey

ToPrivKey returns the key usable for signing.

type Raw

type Raw []byte

Raw represents the Stark private key

func (Raw) GoString

func (raw Raw) GoString() string

GoString wraps String()

func (Raw) Key

func (raw Raw) Key() Key

Key gets the Key

func (Raw) String

func (raw Raw) String() string

String returns description

Jump to

Keyboard shortcuts

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