signature

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 8 Imported by: 5

Documentation

Overview

Package signature provides functionality for interacting with the X-Flashbots-Signature header.

Index

Constants

View Source
const HTTPHeader = "X-Flashbots-Signature"

HTTPHeader is the name of the X-Flashbots-Signature header.

Variables

View Source
var (
	ErrNoSignature      = errors.New("no signature provided")
	ErrInvalidSignature = errors.New("invalid signature provided")
)

Functions

func Create

func Create(body []byte, privateKey *ecdsa.PrivateKey) (header string, err error)

Create takes a body and a private key and returns a X-Flashbots-Signature header value. The header value can be included in a HTTP request to sign the body.

func Verify

func Verify(header string, body []byte) (common.Address, error)

Verify takes a X-Flashbots-Signature header and a body and verifies that the signature is valid for the body. It returns the signing address if the signature is valid or an error if the signature is invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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