Documentation ¶
Index ¶
- Constants
- func ClaimsText(name string) string
- func HeaderParameterText(param string) string
- type AuthKey
- func (a *AuthKey) GetSignedKey(token *jwt.Token) (interface{}, error)
- func (a *AuthKey) GetSignedMethod() jwt.SigningMethod
- func (a *AuthKey) GetVerifiedKey(token *jwt.Token) (interface{}, error)
- func (a *AuthKey) IsECMAKey() bool
- func (a *AuthKey) IsRSAKey() bool
- func (a *AuthKey) IsSymmetricKey() bool
Constants ¶
View Source
const ( // Registered Claim Names ClaimsIssuer = "iss" // RFC 7519, 4.1.1 ClaimsSubject = "sub" // RFC 7519, 4.1.2 ClaimsAudience = "aud" // RFC 7519, 4.1.3 ClaimsExpirationTime = "exp" // RFC 7519, 4.1.4 ClaimsNotBefore = "nbf" // RFC 7519, 4.1.5 ClaimsIssuedAt = "iat" // RFC 7519, 4.1.6 ClaimsJWTID = "jti" // RFC 7519, 4.1.7 )
See: https://tools.ietf.org/html/rfc7519
View Source
const ( // JOSE Header HeaderParameterType = "type" // RFC 7231, 5.1 HeaderParameterContentType = "cty" // RFC 7231, 5.2 // Replicating Claims as Header Parameters HeaderParameterIssuer = ClaimsIssuer // RFC 7231, 5.3 RFC 7519, 10.4.1 HeaderParameterSubject = ClaimsSubject // RFC 7231, 5.3 RFC 7519, 10.4.1 HeaderParameterAudience = ClaimsAudience // RFC 7231, 5.3 RFC 7519, 10.4.1 HeaderParameterExpirationTime = ClaimsExpirationTime // RFC 7231, 5.3 HeaderParameterNotBefore = ClaimsNotBefore // RFC 7231, 5.3 HeaderParameterIssuedAt = ClaimsIssuedAt // RFC 7231, 5.3 HeaderParameterJWTID = ClaimsJWTID // RFC 7231, 5.3 )
View Source
const ( SigningMethodNone = "none" SigningMethodHS256 = "HS256" // HS256: HMAC using SHA-256 SigningMethodHS384 = "HS384" // HS384: HMAC using SHA-384 SigningMethodHS512 = "HS512" // HS512: HMAC using SHA-512 SigningMethodRS256 = "RS256" // RS256: RSASSA-PKCS-v1_5 using SHA-256 SigningMethodRS384 = "RS384" // RS384: RSASSA-PKCS-v1_5 using SHA-384 SigningMethodRS512 = "RS512" // RS512: RSASSA-PKCS-v1_5 using SHA-512 SigningMethodPS256 = "PS256" // PS256: RSASSA-PSS using SHA-256 and MGF1 with SHA-256 SigningMethodPS384 = "PS384" // PS384: RSASSA-PSS using SHA-384 and MGF1 with SHA-384 SigningMethodPS512 = "PS512" // PS512: RSASSA-PSS using SHA-512 and MGF1 with SHA-512 SigningMethodES256 = "ES256" // ES256: ECDSA using P-256 and SHA-256 SigningMethodES384 = "ES384" // ES384: ECDSA using P-384 and SHA-384 SigningMethodES512 = "ES512" // ES512: ECDSA using P-521 and SHA-512 )
Variables ¶
This section is empty.
Functions ¶
func ClaimsText ¶
ClaimsText returns a text for the Claim Names. It returns the empty string if the code is "".
func HeaderParameterText ¶
HeaderParameterText returns a text for the Claim Names. It returns the empty string if the code is "".
Types ¶
type AuthKey ¶
type AuthKey struct {
// contains filtered or unexported fields
}
func NewAuthKey ¶
func NewAuthKey(alg string, privateKey []byte, publicKey []byte, password ...string) (*AuthKey, error)
SymmetricKey : privateKey else: privKey publicKey
func NewAuthKeyFromFile ¶
func NewAuthKeyFromRandom ¶
func (*AuthKey) GetSignedKey ¶
func (*AuthKey) GetSignedMethod ¶
func (a *AuthKey) GetSignedMethod() jwt.SigningMethod
func (*AuthKey) GetVerifiedKey ¶
func (*AuthKey) IsSymmetricKey ¶
Click to show internal directories.
Click to hide internal directories.