Documentation ¶
Overview ¶
Package security provides security related things.
Index ¶
- func GetPrivateKey(signingMethod string) (interface{}, error)
- func GetPublicKey(signingMethod string) (interface{}, error)
- func GetSigningMethod() jwt.SigningMethod
- func GetTokenSignedString(t *jwt.Token) (string, error)
- func InitFromConfig(cfg config.Config) error
- func NewToken() *jwt.Token
- func NewTokenWithClaims(claims jwt.Claims) *jwt.Token
- func ParseToken(s string) (*jwt.Token, error)
- func ParseTokenWithClaims(s string, claims jwt.Claims) (*jwt.Token, error)
- func SetECDSAPrivateKey(k []byte) error
- func SetECDSAPublicKey(k []byte) error
- func SetHMACKey(k []byte)
- func SetRSAPrivateKey(k []byte) error
- func SetRSAPublicKey(k []byte) error
- func SetSigningMethod(alg string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPrivateKey ¶
GetPrivateKey returns a private key configured for a signing method.
func GetPublicKey ¶
GetPublicKey returns a public key configured for a signing method.
func GetSigningMethod ¶
func GetSigningMethod() jwt.SigningMethod
GetSigningMethod returns a default signing method.
func GetTokenSignedString ¶
GetTokenSignedString returns a token as a signed string.
func InitFromConfig ¶
InitFromConfig initializes security from config.
func NewTokenWithClaims ¶
func NewTokenWithClaims(claims jwt.Claims) *jwt.Token
NewTokenWithClaims creates a new JWT token with claims section.
func ParseToken ¶
ParseToken parses a signed token string without claims section.
func ParseTokenWithClaims ¶
ParseTokenWithClaims parses a signed token string with claims section.
func SetECDSAPrivateKey ¶
SetECDSAPrivateKey sets an ECDSA private key.
func SetECDSAPublicKey ¶
SetECDSAPublicKey sets an ECDSA public key.
func SetRSAPrivateKey ¶
SetRSAPrivateKey sets an RSA private key.
func SetSigningMethod ¶
SetSigningMethod sets a default signing method.
Types ¶
This section is empty.