Documentation
¶
Overview ¶
jwt allows the easy programmatic creation of jwt signing-keys and tokens, mainly for testing purposes.
Index ¶
- func CreateToken(signer jose.Signer, cl jwt.Claims, privateClaims ...interface{}) (string, error)
- func CreateWebkeyPair(alg jose.SignatureAlgorithm, use string) (jose.JSONWebKey, jose.JSONWebKey, error)
- func GenerateSigningKey(alg jose.SignatureAlgorithm, bits int) (crypto.PublicKey, crypto.PrivateKey, error)
- func GenerateToken(tenant string, grps []string, issuedAt, expiresAt time.Time) (string, error)
- func MustMakeSigner(alg jose.SignatureAlgorithm, k interface{}) jose.Signer
- type ExtendedClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
CreateToken creates a jwt token with the given claims
func CreateWebkeyPair ¶
func CreateWebkeyPair(alg jose.SignatureAlgorithm, use string) (jose.JSONWebKey, jose.JSONWebKey, error)
CreateWebkeyPair creates a JSONWebKey-Pair. alg is one of jose signature-algorithm constants, e.g. jose.RS256. use is "sig" for signature or "enc" for encryption, see https://tools.ietf.org/html/rfc7517#page-6
func GenerateSigningKey ¶
func GenerateSigningKey(alg jose.SignatureAlgorithm, bits int) (crypto.PublicKey, crypto.PrivateKey, error)
GenerateSigningKey generates a keypair for corresponding SignatureAlgorithm.
func GenerateToken ¶
func MustMakeSigner ¶
func MustMakeSigner(alg jose.SignatureAlgorithm, k interface{}) jose.Signer
MustMakeSigner creates a Signer and panics if an error occurs
Types ¶
Click to show internal directories.
Click to hide internal directories.