Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidContentType is an error that indicates invalid content type. ErrInvalidContentType = errors.New("invalid content type") // ErrInvalidHeader is an error that indicates invalid X-Content-Security header. ErrInvalidHeader = errors.New("invalid X-Content-Security header") // ErrInvalidKey is an error that indicates invalid key. ErrInvalidKey = errors.New("invalid key") // ErrInvalidPublicKey is an error that indicates invalid public key. ErrInvalidPublicKey = errors.New("invalid public key") // ErrInvalidSecret is an error that indicates invalid secret. ErrInvalidSecret = errors.New("invalid secret") )
Functions ¶
func VerifySignature ¶
func VerifySignature(r *http.Request, securityHeader *ContentSecurityHeader, tolerance time.Duration) int
VerifySignature verifies the signature in given r.
Types ¶
type ContentSecurityHeader ¶
A ContentSecurityHeader is a content security header.
func ParseContentSecurity ¶
func ParseContentSecurity(decrypters map[string]codec.RsaDecrypter, r *http.Request) ( *ContentSecurityHeader, error)
ParseContentSecurity parses content security settings in give r.
func (*ContentSecurityHeader) Encrypted ¶
func (h *ContentSecurityHeader) Encrypted() bool
Encrypted checks if it's a crypted request.
Click to show internal directories.
Click to hide internal directories.