Documentation ¶
Index ¶
Constants ¶
View Source
const ( ALG_NONE = Algorithm("none") ALG_HS256 = Algorithm("HS256") ALG_HS384 = Algorithm("HS384") ALG_HS512 = Algorithm("HS512") ALG_RS256 = Algorithm("RS256") ALG_RS384 = Algorithm("RS384") ALG_RS512 = Algorithm("RS512") ALG_ES256 = Algorithm("ES256") ALG_ES384 = Algorithm("ES384") ALG_ES512 = Algorithm("ES512") ALG_PS256 = Algorithm("PS256") ALG_PS384 = Algorithm("PS384") ALG_PS512 = Algorithm("PS512") )
View Source
const NoneKey = NoneKeyType(0)
Variables ¶
This section is empty.
Functions ¶
func VerifyAndDecode ¶
func VerifyAndDecode(jws string, kp KeyProvider) (payload []byte, err error)
Types ¶
type Header ¶
type Header struct { Alg Algorithm `json:"alg"` Typ string `json:"typ,omitempty"` Cty string `json:"cty,omitempty"` Jku string `json:"jku,omitempty"` Jwk string `json:"jwk,omitempty"` X5u string `json:"x5u,omitempty"` X5t string `json:"x5t,omitempty"` X5c string `json:"x5c,omitempty"` Kid string `json:"kid,omitempty"` }
JWS header
func VerifyAndDecodeWithHeader ¶
func VerifyAndDecodeWithHeader(jws string, kp KeyProvider) (header Header, payload []byte, err error)
Verify the authenticity of a JWS signature
type KeyProvider ¶
Allows caller access to the JWS header while selecting an appropriate public key.
func ProviderFromKey ¶
func ProviderFromKey(key crypto.PublicKey) KeyProvider
convert a single key into a provider
type NoneKeyType ¶
type NoneKeyType int
Public key to use for "none" algorithm. This type effectively works as a flag allowing no signature verification if none is provided in the JWS
Click to show internal directories.
Click to hide internal directories.