signer

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RingSigner

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

RingSigner is a signer implementation that uses a ring to sign messages, for verification the ring signature must be verified and confirmed to be using the expected ring.

func NewRingSigner

func NewRingSigner(ring *ring.Ring, privKey ringtypes.Scalar) *RingSigner

NewRingSigner creates a new RingSigner instance with the ring and private key provided

func (*RingSigner) Sign

func (r *RingSigner) Sign(msg [32]byte) ([]byte, error)

Sign uses the ring and private key to sign the message provided and returns the serialized ring signature that can be deserialized and verified by the verifier

type Signer

type Signer interface {
	Sign(msg [32]byte) (signature []byte, err error)
}

Signer is an interface that abstracts the signing of a message, it is used to sign both relay requests and responses via one of the two implementations. The Signer interface expects a 32 byte message (sha256 hash) and returns a byte slice containing the signature or any error that occurred during signing.

type SimpleSigner

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

SimpleSigner is a signer implementation that uses a private key to sign messages.

func NewSimpleSigner

func NewSimpleSigner(kr keyring.Keyring, keyName string) (*SimpleSigner, error)

NewSimpleSigner creates a new SimpleSigner instance with the keyring and keyName provided It uses the private key associated with the keyName in the keyring to sign messages.

func (*SimpleSigner) Sign

func (s *SimpleSigner) Sign(msg [32]byte) (signature []byte, err error)

Sign signs the given message using the SimpleSigner's private key.

Jump to

Keyboard shortcuts

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