Documentation ¶
Index ¶
- Constants
- func ECDSASign(priv string, payload string) (hash string, err error)
- func ECDSAVerify(pub1 string, pub2 string, payload string, sig string) bool
- func GenerateECDSAKeyPair() (pub1, pub2, private string, err error)
- func GetPayloadFromHTTPRequest(r *http.Request) (string, error)
- func GetSignFromHTTPRequest(r *http.Request, key, secret, private string, algorithm AuthAlgorithm) (string, error)
- func SumSha1Hmac(secret, payload string) string
- func SumSha256Hmac(secret string, payload ...string) string
- func SumSha512Hmac(secret string, payload ...string) string
- func Verify(key, secret, private string, algorithm AuthAlgorithm, signStr, payload string) bool
- type AuthAlgorithm
Constants ¶
View Source
const ( MimeJSON = "application/json" MimeXML = "application/xml" MimeUrlencoded = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func GenerateECDSAKeyPair ¶
func GetSignFromHTTPRequest ¶
func SumSha1Hmac ¶
func SumSha256Hmac ¶
func SumSha512Hmac ¶
Types ¶
type AuthAlgorithm ¶
type AuthAlgorithm string
const ( HmacSha1 AuthAlgorithm = "HMAC-SHA1" HmacSha256 AuthAlgorithm = "HMAC-SHA256" HmacSha512 AuthAlgorithm = "HMAC-SHA512" ECDSA AuthAlgorithm = "ECDSA" )
Click to show internal directories.
Click to hide internal directories.