Documentation
¶
Index ¶
- Constants
- func SignRequest(ctx context.Context, headers http.Header, inputValue *input.Value, key any) error
- func SignResponse(ctx context.Context, headers http.Header, inputValue *input.Value, key any) error
- func VerifyRequest(ctx context.Context, headers http.Header, keyOrResolver any, ...) error
- func VerifyResponse(ctx context.Context, headers http.Header, keyOrResolver any, ...) error
- type Clock
- type KeyResolver
- type Option
- type SystemClock
- type VerifyOption
Constants ¶
const ( SignatureInputHeader = "Signature-Input" SignatureHeader = "Signature" )
const ( AlgorithmRSAPSSSHA512 = "rsa-pss-sha512" // Section 3.3.1 AlgorithmRSAV15SHA256 = "rsa-v1_5-sha256" // Section 3.3.2 AlgorithmHMACSHA256 = "hmac-sha256" // Section 3.3.3 AlgorithmECDSAP256SHA256 = "ecdsa-p256-sha256" // Section 3.3.4 AlgorithmECDSAP384SHA384 = "ecdsa-p384-sha384" // Section 3.3.5 AlgorithmEd25519 = "ed25519" // Section 3.3.6 )
RFC 9421 Algorithm Names (Section 6.2.2 Initial Contents)
Variables ¶
This section is empty.
Functions ¶
func SignRequest ¶
SignRequest signs an HTTP request using the provided headers. Request information must be provided in context using component.WithRequestInfo.
func SignResponse ¶
SignResponse signs an HTTP response using the provided headers. Response information must be provided in context using component.WithResponseInfo.
func VerifyRequest ¶
func VerifyRequest(ctx context.Context, headers http.Header, keyOrResolver any, options ...VerifyOption) error
VerifyRequest verifies HTTP request signatures using the provided headers. Request information must be provided in context using component.WithRequestInfo.
func VerifyResponse ¶
func VerifyResponse(ctx context.Context, headers http.Header, keyOrResolver any, options ...VerifyOption) error
VerifyResponse verifies HTTP response signatures using the provided headers. Response information must be provided in context using component.WithResponseInfo.
Types ¶
type KeyResolver ¶
KeyResolver interface allows resolving cryptographic keys by their ID
type SystemClock ¶
type SystemClock struct{}
SystemClock uses the system time.
func (SystemClock) Now ¶
func (SystemClock) Now() time.Time
type VerifyOption ¶
type VerifyOption interface {
Option
// contains filtered or unexported methods
}
VerifyOption configures signature verification behavior
func WithClock ¶
func WithClock(clock Clock) VerifyOption
WithClock returns a VerifyOption that sets the clock for expiration checking
func WithValidateExpires ¶
func WithValidateExpires(validate bool) VerifyOption
WithValidateExpires returns a VerifyOption that enables or disables expiration validation