signer

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 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 the local keyring to sign messages, for verification using the signer's corresponding public key.

func NewSimpleSigner

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

NewSimpleSigner creates a new SimpleSigner instance with the keyring and keyName provided

func (*SimpleSigner) Sign

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

Sign signs the given message using the SimpleSigner's keyring and keyName

Jump to

Keyboard shortcuts

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