signer

package
v0.0.0-...-86835dc Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

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

func NewLocal

func NewLocal(privateKey *ecdsa.PrivateKey) *Local

NewLocal creates a new LocalSigner with the given private key.

func (*Local) Decrypt

func (l *Local) Decrypt(_ context.Context, cipher []byte) (hexutil.Bytes, error)

Decrypt decrypts the cipher.

func (*Local) Identify

func (l *Local) Identify(_ context.Context) (types.PublicKey, error)

Identify retrieves identity of the signer.

func (*Local) Sign

func (l *Local) Sign(_ context.Context, hashes []common.Hash) ([]hexutil.Bytes, error)

Sign computes textHash of each hash and returns a slice of ecdsa signatures.

type Remote

type Remote struct{ *config.Credentials }

Signer holds credentials for the signer server.

func (*Remote) Decrypt

func (r *Remote) Decrypt(ctx context.Context, cipher []byte) (hexutil.Bytes, error)

Decrypt sends cipher to signer for decryption.

func (*Remote) Identify

func (r *Remote) Identify(ctx context.Context) (types.PublicKey, error)

Identify retrieves identity of the signer.

func (*Remote) Sign

func (r *Remote) Sign(ctx context.Context, hashes []common.Hash) ([]hexutil.Bytes, error)

Sign sends hashes to signer and returns the corresponding signatures.

type Signer

type Signer interface {
	// Sign signs each hash.
	Sign(ctx context.Context, hashes []common.Hash) ([]hexutil.Bytes, error)

	// Decrypt decrypts the cipher.
	Decrypt(ctx context.Context, cipher []byte) (hexutil.Bytes, error)

	// Identify retrieves identity of the signer.
	Identify(ctx context.Context) (types.PublicKey, error)
}

Jump to

Keyboard shortcuts

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