Versions in this module Expand all Collapse all v3 v3.2.2 May 21, 2020 Changes in this version + const UnsafeAllowNoneSignatureType + const ValidationErrorAudience + const ValidationErrorClaimsInvalid + const ValidationErrorExpired + const ValidationErrorId + const ValidationErrorIssuedAt + const ValidationErrorIssuer + const ValidationErrorMalformed + const ValidationErrorNotValidYet + const ValidationErrorSignatureInvalid + const ValidationErrorUnverifiable + var ErrECDSAVerification = errors.New("crypto/ecdsa: verification error") + var ErrHashUnavailable = errors.New("the requested hash function is unavailable") + var ErrInvalidKey = errors.New("key is invalid") + var ErrInvalidKeyType = errors.New("key is of invalid type") + var ErrKeyMustBePEMEncoded = errors.New("Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key") + var ErrNotECPrivateKey = errors.New("Key is not a valid ECDSA private key") + var ErrNotECPublicKey = errors.New("Key is not a valid ECDSA public key") + var ErrNotRSAPrivateKey = errors.New("Key is not a valid RSA private key") + var ErrNotRSAPublicKey = errors.New("Key is not a valid RSA public key") + var NoneSignatureTypeDisallowedError error + var SigningMethodNone *signingMethodNone + var TimeFunc = time.Now + func DecodeSegment(seg string) ([]byte, error) + func EncodeSegment(seg []byte) string + func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) + func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) + func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) + func ParseRSAPrivateKeyFromPEMWithPassword(key []byte, password string) (*rsa.PrivateKey, error) + func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) + func RegisterSigningMethod(alg string, f func() SigningMethod) + type Claims interface + Valid func() error + type Keyfunc func(*Token) (interface{}, error) + type MapClaims map[string]interface + func (m MapClaims) Valid() error + func (m MapClaims) VerifyAudience(cmp string, req bool) bool + func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool + func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool + func (m MapClaims) VerifyIssuer(cmp string, req bool) bool + func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool + type Parser struct + SkipClaimsValidation bool + UseJSONNumber bool + ValidMethods []string + func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) + func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) + func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) + type SigningMethod interface + Alg func() string + Sign func(signingString string, key interface{}) (string, error) + Verify func(signingString, signature string, key interface{}) error + func GetSigningMethod(alg string) (method SigningMethod) + type SigningMethodECDSA struct + CurveBits int + Hash crypto.Hash + KeySize int + Name string + var SigningMethodES256 *SigningMethodECDSA + var SigningMethodES384 *SigningMethodECDSA + var SigningMethodES512 *SigningMethodECDSA + func (m *SigningMethodECDSA) Alg() string + func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) (string, error) + func (m *SigningMethodECDSA) Verify(signingString, signature string, key interface{}) error + type SigningMethodHMAC struct + Hash crypto.Hash + Name string + var ErrSignatureInvalid = errors.New("signature is invalid") + var SigningMethodHS256 *SigningMethodHMAC + var SigningMethodHS384 *SigningMethodHMAC + var SigningMethodHS512 *SigningMethodHMAC + func (m *SigningMethodHMAC) Alg() string + func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) (string, error) + func (m *SigningMethodHMAC) Verify(signingString, signature string, key interface{}) error + type SigningMethodRSA struct + Hash crypto.Hash + Name string + var SigningMethodRS256 *SigningMethodRSA + var SigningMethodRS384 *SigningMethodRSA + var SigningMethodRS512 *SigningMethodRSA + func (m *SigningMethodRSA) Alg() string + func (m *SigningMethodRSA) Sign(signingString string, key interface{}) (string, error) + func (m *SigningMethodRSA) Verify(signingString, signature string, key interface{}) error + type SigningMethodRSAPSS struct + Options *rsa.PSSOptions + var SigningMethodPS256 *SigningMethodRSAPSS + var SigningMethodPS384 *SigningMethodRSAPSS + var SigningMethodPS512 *SigningMethodRSAPSS + func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) (string, error) + func (m *SigningMethodRSAPSS) Verify(signingString, signature string, key interface{}) error + type StandardClaims struct + Audience string + ExpiresAt int64 + Id string + IssuedAt int64 + Issuer string + NotBefore int64 + Subject string + func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool + func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool + func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool + func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool + func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool + func (c StandardClaims) Valid() error + type Token struct + Claims Claims + Header map[string]interface{} + Method SigningMethod + Raw string + Signature string + Valid bool + func New(method SigningMethod) *Token + func NewWithClaims(method SigningMethod, claims Claims) *Token + func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) + func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) + func (t *Token) SignedString(key interface{}) (string, error) + func (t *Token) SigningString() (string, error) + type ValidationError struct + Errors uint32 + Inner error + func NewValidationError(errorText string, errorFlags uint32) *ValidationError + func (e ValidationError) Error() string Other modules containing this package github.com/reddit/jwt-go