acme

package
v0.0.0-...-4afbf41 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JwsProtectedKey   contextKey = "jws_protected"
	AccountIDKey      contextKey = "account_id"
	DecodedPayloadKey contextKey = "decoded_payload"
)

Variables

This section is empty.

Functions

func JWSVerificationMiddleware

func JWSVerificationMiddleware(next http.Handler) http.Handler

JWSVerificationMiddleware verifies the JWS signature of ACME requests

func NonceMiddleware

func NonceMiddleware(next http.Handler) http.Handler

NonceMiddleware adds a nonce to all responses

Types

type JWSHeader

type JWSHeader struct {
	Alg   string      `json:"alg"`           // The algorithm used for the signature
	Nonce string      `json:"nonce"`         // The nonce value
	URL   string      `json:"url"`           // The request URL
	Kid   string      `json:"kid,omitempty"` // Key identifier (for existing accounts)
	Jwk   interface{} `json:"jwk,omitempty"` // JWK (for new accounts)
}

JWSHeader represents the protected header of a JWS

type JWSRequest

type JWSRequest struct {
	Protected string `json:"protected"` // Base64URL(UTF8(JWS Protected Header))
	Payload   string `json:"payload"`   // Base64URL(JWS Payload)
	Signature string `json:"signature"` // Base64URL(JWS Signature)
}

JWSRequest represents a JWS request structure

type MemoryNonceStore

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

func NewMemoryNonceStore

func NewMemoryNonceStore() *MemoryNonceStore

func (*MemoryNonceStore) CleanExpired

func (s *MemoryNonceStore) CleanExpired() error

func (*MemoryNonceStore) StoreNonce

func (s *MemoryNonceStore) StoreNonce(nonce string) error

func (*MemoryNonceStore) ValidateAndRemove

func (s *MemoryNonceStore) ValidateAndRemove(nonce string) error

type NonceStore

type NonceStore interface {
	StoreNonce(nonce string) error
	ValidateAndRemove(nonce string) error
	CleanExpired() error
}

Add after the imports

Jump to

Keyboard shortcuts

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