signer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DigestLength = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key []byte

func (Key) Address

func (k Key) Address() ids.Address

func (Key) AsKey

func (k Key) AsKey() string

func (Key) Bytes

func (k Key) Bytes() []byte

func (Key) Clone

func (k Key) Clone() Key

func (Key) Equal

func (k Key) Equal(b Key) bool

func (Key) GoString

func (k Key) GoString() string

func (Key) IsAddress

func (k Key) IsAddress(addr ids.Address) bool

func (Key) Kind

func (k Key) Kind() Kind

func (Key) MarshalCBOR

func (k Key) MarshalCBOR() ([]byte, error)

func (Key) MarshalJSON

func (k Key) MarshalJSON() ([]byte, error)

func (Key) MarshalText

func (k Key) MarshalText() ([]byte, error)

func (Key) Ptr

func (k Key) Ptr() *Key

func (Key) String

func (k Key) String() string

func (*Key) UnmarshalCBOR

func (k *Key) UnmarshalCBOR(data []byte) error

func (*Key) UnmarshalJSON

func (k *Key) UnmarshalJSON(b []byte) error

func (*Key) UnmarshalText

func (k *Key) UnmarshalText(b []byte) error

func (Key) Valid

func (k Key) Valid() error

func (Key) ValidOrEmpty

func (k Key) ValidOrEmpty() error

func (Key) Verify

func (k Key) Verify(digestHash []byte, sigs Sigs) bool

type Keys

type Keys []Key

func (Keys) Clone

func (ks Keys) Clone() Keys

func (Keys) FindKeyOrAddr

func (ks Keys) FindKeyOrAddr(addr ids.Address) Key

func (Keys) Has

func (ks Keys) Has(key Key) bool

func (Keys) HasAddress

func (ks Keys) HasAddress(addr ids.Address) bool

func (Keys) HasKeys added in v0.1.1

func (ks Keys) HasKeys(keys Keys, threshold uint16) bool

func (Keys) Valid

func (ks Keys) Valid() error

func (Keys) Verify

func (ks Keys) Verify(digestHash []byte, sigs Sigs, threshold uint16) bool

func (Keys) VerifyPlus

func (ks Keys) VerifyPlus(digestHash []byte, sigs Sigs, threshold uint16) bool

type Kind

type Kind uint8
const (
	Unknown Kind = iota
	Ed25519
	Secp256k1
	BLS12381
)

type Sig

type Sig []byte

func (Sig) AsKey

func (s Sig) AsKey() string

func (Sig) Bytes

func (s Sig) Bytes() []byte

func (Sig) Clone

func (s Sig) Clone() Sig

func (Sig) Equal

func (s Sig) Equal(b Sig) bool

func (Sig) FindKey

func (s Sig) FindKey(digestHash []byte, keys ...Key) int

func (Sig) GoString

func (s Sig) GoString() string

func (Sig) Kind

func (s Sig) Kind() Kind

func (Sig) MarshalCBOR

func (s Sig) MarshalCBOR() ([]byte, error)

func (Sig) MarshalJSON

func (s Sig) MarshalJSON() ([]byte, error)

func (Sig) MarshalText

func (s Sig) MarshalText() ([]byte, error)

func (Sig) Ptr

func (s Sig) Ptr() *Sig

func (Sig) String

func (s Sig) String() string

func (*Sig) UnmarshalCBOR

func (s *Sig) UnmarshalCBOR(data []byte) error

func (*Sig) UnmarshalJSON

func (s *Sig) UnmarshalJSON(b []byte) error

func (*Sig) UnmarshalText

func (s *Sig) UnmarshalText(b []byte) error

func (Sig) Valid

func (s Sig) Valid() error

type Signer

type Signer interface {
	Kind() Kind
	Key() Key
	PrivateSeed() []byte
	SignHash(digestHash []byte) (Sig, error)
	SignData(message []byte) (Sig, error)
	Sign(message []byte) (Sig, error)
}

func BLS12381From

func BLS12381From(privateSeed []byte) (Signer, error)

func Ed25519From

func Ed25519From(privateSeed []byte) (Signer, error)

func NewBLS12381

func NewBLS12381() (Signer, error)

func NewEd25519

func NewEd25519() (Signer, error)

func NewSecp256k1

func NewSecp256k1() (Signer, error)

func Secp256k1From

func Secp256k1From(privateSeed []byte) (Signer, error)

type Sigs

type Sigs []Sig

func (Sigs) Valid

func (ss Sigs) Valid() error

Jump to

Keyboard shortcuts

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