Versions in this module Expand all Collapse all v0 v0.14.0 Apr 24, 2024 v0.13.0 Feb 27, 2024 Changes in this version + const CryptoKeysPropertiesPrefix + const JwtHeaderAlgorithm + const JwtHeaderKid + const JwtHeaderType + func ParseJwtHeaders(jwtValue string) (map[string]interface{}, error) + type CryptoKeyProperties struct + Id string + KeyFormat string + Location string + Password string + func (p CryptoKeyProperties) Format() KeyFormatType + type CryptoProperties struct + Jwt JwtProperties + Keys map[string]CryptoKeyProperties + func BindCryptoProperties(ctx *bootstrap.ApplicationContext) CryptoProperties + func NewCryptoProperties() *CryptoProperties + type FileJwkStore struct + func NewFileJwkStore(props CryptoProperties) *FileJwkStore + func (s *FileJwkStore) LoadAll(_ context.Context, names ...string) ([]Jwk, error) + func (s *FileJwkStore) LoadByKid(_ context.Context, kid string) (Jwk, error) + func (s *FileJwkStore) LoadByName(_ context.Context, name string) (Jwk, error) + func (s *FileJwkStore) Rotate(_ context.Context, name string) error + type Jwk interface + Id func() string + Name func() string + Public func() crypto.PublicKey + type JwkRotator interface + Rotate func(ctx context.Context, name string) error + type JwkStore interface + LoadAll func(ctx context.Context, names ...string) ([]Jwk, error) + LoadByKid func(ctx context.Context, kid string) (Jwk, error) + LoadByName func(ctx context.Context, name string) (Jwk, error) + type JwtDecoder interface + Decode func(ctx context.Context, token string) (oauth2.Claims, error) + DecodeWithClaims func(ctx context.Context, token string, claims interface{}) error + type JwtEncoder interface + Encode func(ctx context.Context, claims interface{}) (string, error) + type JwtProperties struct + KeyName string + type KeyFormatType string + const KeyFileFormatPem + type PlaintextJwtDecoder struct + func NewPlaintextJwtDecoder() *PlaintextJwtDecoder + func (dec *PlaintextJwtDecoder) Decode(ctx context.Context, tokenString string) (oauth2.Claims, error) + func (dec *PlaintextJwtDecoder) DecodeWithClaims(_ context.Context, tokenString string, claims interface{}) (err error) + type PrivateJwk interface + Private func() crypto.PrivateKey + type RSJwtDecoder struct + func NewRS256JwtDecoder(jwkStore JwkStore, defaultJwkName string) *RSJwtDecoder + func (dec *RSJwtDecoder) Decode(ctx context.Context, tokenString string) (oauth2.Claims, error) + func (dec *RSJwtDecoder) DecodeWithClaims(ctx context.Context, tokenString string, claims interface{}) (err error) + type RSJwtEncoder struct + func NewRS256JwtEncoder(jwkStore JwkStore, jwkName string) *RSJwtEncoder + func (enc *RSJwtEncoder) Encode(ctx context.Context, claims interface{}) (string, error) + type RsaKeyPair struct + func NewRsaPrivateJwk(kid string, name string, privateKey *rsa.PrivateKey) *RsaKeyPair + func (k *RsaKeyPair) Id() string + func (k *RsaKeyPair) Name() string + func (k *RsaKeyPair) Private() crypto.PrivateKey + func (k *RsaKeyPair) Public() crypto.PublicKey + type RsaPublicKey struct + func NewRsaJwk(kid string, name string, publicKey *rsa.PublicKey) *RsaPublicKey + func (k *RsaPublicKey) Id() string + func (k *RsaPublicKey) Name() string + func (k *RsaPublicKey) Public() crypto.PublicKey + type SingleJwkStore struct + func NewSingleJwkStore(kid string) *SingleJwkStore + func (s *SingleJwkStore) LoadAll(ctx context.Context, names ...string) ([]Jwk, error) + func (s *SingleJwkStore) LoadByKid(_ context.Context, kid string) (Jwk, error) + func (s *SingleJwkStore) LoadByName(_ context.Context, name string) (Jwk, error) + type StaticJwkStore struct + func NewStaticJwkStore(kids ...string) *StaticJwkStore + func (s *StaticJwkStore) LoadAll(ctx context.Context, names ...string) ([]Jwk, error) + func (s *StaticJwkStore) LoadByKid(_ context.Context, kid string) (Jwk, error) + func (s *StaticJwkStore) LoadByName(_ context.Context, name string) (Jwk, error) + func (s *StaticJwkStore) Rotate(ctx context.Context, name string) error