mpcclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderTimestamp = "X-Ironhand-MPC-Timestamp"
	HeaderNonce     = "X-Ironhand-MPC-Nonce"
	HeaderBodyHash  = "X-Ironhand-MPC-Body-SHA256"
	HeaderSignature = "X-Ironhand-MPC-Signature"
)

Variables

This section is empty.

Functions

func SignRequest

func SignRequest(req *http.Request, sharedKey []byte, body []byte, now time.Time)

func VerifyRequest

func VerifyRequest(r *http.Request, sharedKey []byte, maxSkew time.Duration) ([]byte, bool, error)

func VerifyRequestWithReplay

func VerifyRequestWithReplay(r *http.Request, sharedKey []byte, maxSkew time.Duration, replay *ReplayCache) ([]byte, bool, error)

Types

type Client

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

func New

func New(sharedKey []byte, tlsConfig *tls.Config) *Client

func (*Client) GetJSON

func (c *Client) GetJSON(url string, out any) error

func (*Client) PostJSON

func (c *Client) PostJSON(url string, in any, out any) error

type ReplayCache

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

func NewReplayCache

func NewReplayCache(maxSkew time.Duration) *ReplayCache

func (*ReplayCache) Mark

func (c *ReplayCache) Mark(nonce string, now time.Time) bool

Jump to

Keyboard shortcuts

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