signer

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: BSD-3-Clause Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Sign signs a message with multiple signers
	Sign(ctx context.Context, msg *warp.UnsignedMessage, signerIndices []int) (*warp.Message, error)

	// GetValidators returns the current validator set
	GetValidators(ctx context.Context) ([]*warp.Validator, error)
}

Backend is an interface for signing backends

type LocalSigner

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

LocalSigner signs messages with a local secret key

func NewLocalSigner

func NewLocalSigner(sk *bls.SecretKey) *LocalSigner

NewLocalSigner creates a new local signer

func (*LocalSigner) GetPublicKey

func (s *LocalSigner) GetPublicKey() *bls.PublicKey

GetPublicKey returns the public key

func (*LocalSigner) Sign

func (s *LocalSigner) Sign(msg *warp.UnsignedMessage) (*bls.Signature, error)

Sign signs a message

type RemoteSigner

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

RemoteSigner signs messages via RPC

func NewRemoteSigner

func NewRemoteSigner(client SignerClient) (*RemoteSigner, error)

NewRemoteSigner creates a new remote signer

func (*RemoteSigner) GetPublicKey

func (s *RemoteSigner) GetPublicKey() *bls.PublicKey

GetPublicKey returns the public key

func (*RemoteSigner) Sign

func (s *RemoteSigner) Sign(msg *warp.UnsignedMessage) (*bls.Signature, error)

Sign signs a message

type Signer

type Signer interface {
	// Sign signs a message
	Sign(msg *warp.UnsignedMessage) (*bls.Signature, error)

	// GetPublicKey returns the public key
	GetPublicKey() *bls.PublicKey
}

Signer is an interface for signing warp messages

type SignerBackend

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

SignerBackend manages multiple signers

func NewSignerBackend

func NewSignerBackend(validators []*warp.Validator) *SignerBackend

NewSignerBackend creates a new signer backend

func (*SignerBackend) AddSigner

func (b *SignerBackend) AddSigner(index int, signer Signer) error

AddSigner adds a signer for a validator

func (*SignerBackend) GetValidators

func (b *SignerBackend) GetValidators(ctx context.Context) ([]*warp.Validator, error)

GetValidators returns the current validator set

func (*SignerBackend) Sign

func (b *SignerBackend) Sign(
	ctx context.Context, msg *warp.UnsignedMessage, signerIndices []int,
) (*warp.Message, error)

Sign signs a message with multiple signers

type SignerClient

type SignerClient interface {
	// Sign signs a message remotely
	Sign(ctx context.Context, msg []byte) ([]byte, error)

	// GetPublicKey gets the public key
	GetPublicKey(ctx context.Context) ([]byte, error)
}

SignerClient is an interface for remote signing

Jump to

Keyboard shortcuts

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