key

package
v1.11.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0, MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyInfo

type KeyInfo struct {
	// Private key.
	PrivateKey *memguard.Enclave `json:"privateKey"`
	// Cryptographic system used to generate private key.
	SigType types.SigType `json:"type"`
}

KeyInfo is a key and its type used for signing.

func NewBLSKeyFromSeed

func NewBLSKeyFromSeed(seed io.Reader) (KeyInfo, error)

func NewDelegatedKeyFromSeed

func NewDelegatedKeyFromSeed(seed io.Reader) (KeyInfo, error)

func NewSecpKeyFromSeed

func NewSecpKeyFromSeed(seed io.Reader) (KeyInfo, error)

NewSecpKeyFromSeed generates a new key from the given reader.

func (*KeyInfo) Address

func (ki *KeyInfo) Address() (address.Address, error)

Address returns the address for this keyinfo

func (*KeyInfo) Equals

func (ki *KeyInfo) Equals(other *KeyInfo) bool

Equals returns true if the KeyInfo is equal to other.

func (*KeyInfo) Key

func (ki *KeyInfo) Key() []byte

Key returns the private key of KeyInfo This method makes the key escape from memguard's protection, so use caution

func (KeyInfo) MarshalJSON

func (ki KeyInfo) MarshalJSON() ([]byte, error)

func (*KeyInfo) PublicKey

func (ki *KeyInfo) PublicKey() ([]byte, error)

Returns the public key part as uncompressed bytes.

func (*KeyInfo) SetPrivateKey

func (ki *KeyInfo) SetPrivateKey(privateKey []byte)

func (*KeyInfo) Type

func (ki *KeyInfo) Type() types.SigType

Type returns the type of curve used to generate the private key

func (*KeyInfo) UnmarshalJSON

func (ki *KeyInfo) UnmarshalJSON(data []byte) error

func (*KeyInfo) UsePrivateKey

func (ki *KeyInfo) UsePrivateKey(f func([]byte) error) error

Jump to

Keyboard shortcuts

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