Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultClientConfig is the default Client Config. DefaultClientConfig = ClientConfig{ CacheTimeout: defaultCacheTimeout, RequestTimeout: defaultRequestTimeout, } )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client fetch keys from a JSON Web Key set endpoint.
func (*Client) ForceRefresh ¶
func (client *Client) ForceRefresh()
ForceRefresh refresh cache while called. the call is ignored if client is stopped or not started yet.
func (*Client) KeySet ¶
func (client *Client) KeySet() *JSONWebKeySet
KeySet returns the cached JSONWebKeySet.
type ClientConfig ¶
type ClientConfig struct { DisableStrictTLS bool EnableDebug bool AppendCACert bool CACertPath string ServerHostName string CacheTimeout time.Duration RequestTimeout time.Duration Headers map[string]string // contains filtered or unexported fields }
ClientConfig used to init JWKS client.
type JSONWebKey ¶
type JSONWebKey struct { Key interface{} Certificates []*x509.Certificate KeyID string Algorithm string Use string }
JSONWebKey represents a RSA public key in JWK format.
func (JSONWebKey) MarshalJSON ¶
func (key JSONWebKey) MarshalJSON() ([]byte, error)
MarshalJSON returns JSON representation of the given key.
func (*JSONWebKey) Thumbprint ¶
func (key *JSONWebKey) Thumbprint(hash crypto.Hash) ([]byte, error)
Thumbprint returns thumbprint of the given key using the provided hash.
func (*JSONWebKey) UnmarshalJSON ¶
func (key *JSONWebKey) UnmarshalJSON(data []byte) (err error)
UnmarshalJSON returns the key from JSON representation.
type JSONWebKeySet ¶
type JSONWebKeySet struct {
Keys []JSONWebKey `json:"keys"`
}
JSONWebKeySet represents a JWK Set object.
func (*JSONWebKeySet) Key ¶
func (set *JSONWebKeySet) Key(kid string) []JSONWebKey
Key returns keys by key ID.
Click to show internal directories.
Click to hide internal directories.