{"modulePath":"github.com/authgear/authgear-server","version":"v0.0.0-20261127113208-4623cc2f6e05","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpsigning\n\n## Constants\n\n```go\nconst (\n\t// SigningAlgorithm is \"HMAC-SHA256\".\n\tSigningAlgorithm = \"HMAC-SHA256\"\n)\n```\n\n```go\nconst (\n\t// TimeFormat is YYYYMMDD'T'HHMMSS'Z'\n\tTimeFormat = \"2006-01-02T15:04:05Z\"\n)\n```\n\n## Variables\n\n```go\nvar ErrExpiredSignature = apierrors.Invalid.WithReason(\"ExpiredSignature\").New(\"expired signature\")\n```\n\n```go\nvar InvalidSignature = apierrors.Invalid.WithReason(\"InvalidSignature\")\n```\n\n```go\nvar InvalidSignatureQueryParam = apierrors.Invalid.WithReason(\"InvalidSignatureQueryParam\")\n```\n\n## Functions\n\n```go\nfunc CanonicalHeaders(host httputil.HTTPHost) (canonicalHeaders string)\n```\nCanonicalHeaders computes CANONICAL\\_HEADERS and SIGNED\\_HEADERS. Currently only Host is signed.\n\n```go\nfunc CanonicalQueryString(u *url.URL) string\n```\nCanonicalQueryString turns the query string of u into string.\n\n```go\nfunc CanonicalRequest(host httputil.HTTPHost, r *http.Request) []byte\n```\nCanonicalRequest turns r into bytes.\n\n```go\nfunc FormatTime(t time.Time) string\n```\nFormatTime formats t as TimeFormat.\n\n```go\nfunc HMACSHA256(key []byte, data []byte) []byte\n```\nHMACSHA256 is HMAC-SHA256.\n\n```go\nfunc HashedCanonicalRequest(host httputil.HTTPHost, r *http.Request) (hashed string, canonicalRequest []byte)\n```\nHashedCanonicalRequest is HEX(SHA256(CanonicalRequest(host, r))).\n\n```go\nfunc Hex(b []byte) string\n```\nHex is hex.EncodeToString.\n\n```go\nfunc SHA256(b []byte) []byte\n```\nSHA256 is sha256.Sum256.\n\n```go\nfunc Sign(key []byte, r *http.Request, t time.Time, expires int)\n```\nSign turns r into a signed http.Request.\n\n```go\nfunc StringToSign(host httputil.HTTPHost, r *http.Request, t time.Time) (stringToSign []byte, canonicalRequest []byte)\n```\nStringToSign computes StringToSign.\n\n```go\nfunc Verify(key []byte, host httputil.HTTPHost, r *http.Request, now time.Time) error\n```\n\n","path":"github.com/authgear/authgear-server/pkg/util/httpsigning","name":"httpsigning","synopsis":"","isRedistributable":true}
