kubernetes/vendor/gopkg.in/square/go-jose.v2/jwk.go

type rawJSONWebKey

type JSONWebKey

// MarshalJSON serializes the given key to its JSON representation.
func (k JSONWebKey) MarshalJSON() ([]byte, error) {}

// UnmarshalJSON reads a key from its JSON representation.
func (k *JSONWebKey) UnmarshalJSON(data []byte) (err error) {}

type JSONWebKeySet

// Key convenience method returns keys by key ID. Specification states
// that a JWK Set "SHOULD" use distinct key IDs, but allows for some
// cases where they are not distinct. Hence method returns a slice
// of JSONWebKeys.
func (s *JSONWebKeySet) Key(kid string) []JSONWebKey {}

const rsaThumbprintTemplate

const ecThumbprintTemplate

const edThumbprintTemplate

func ecThumbprintInput(curve elliptic.Curve, x, y *big.Int) (string, error) {}

func rsaThumbprintInput(n *big.Int, e int) (string, error) {}

func edThumbprintInput(ed ed25519.PublicKey) (string, error) {}

// Thumbprint computes the JWK Thumbprint of a key using the
// indicated hash algorithm.
func (k *JSONWebKey) Thumbprint(hash crypto.Hash) ([]byte, error) {}

// IsPublic returns true if the JWK represents a public key (not symmetric, not private).
func (k *JSONWebKey) IsPublic() bool {}

// Public creates JSONWebKey with corresponding public key if JWK represents asymmetric private key.
func (k *JSONWebKey) Public() JSONWebKey {}

// Valid checks that the key contains the expected parameters.
func (k *JSONWebKey) Valid() bool {}

func (key rawJSONWebKey) rsaPublicKey() (*rsa.PublicKey, error) {}

func fromEdPublicKey(pub ed25519.PublicKey) *rawJSONWebKey {}

func fromRsaPublicKey(pub *rsa.PublicKey) *rawJSONWebKey {}

func (key rawJSONWebKey) ecPublicKey() (*ecdsa.PublicKey, error) {}

func fromEcPublicKey(pub *ecdsa.PublicKey) (*rawJSONWebKey, error) {}

func (key rawJSONWebKey) edPrivateKey() (ed25519.PrivateKey, error) {}

func (key rawJSONWebKey) edPublicKey() (ed25519.PublicKey, error) {}

func (key rawJSONWebKey) rsaPrivateKey() (*rsa.PrivateKey, error) {}

func fromEdPrivateKey(ed ed25519.PrivateKey) (*rawJSONWebKey, error) {}

func fromRsaPrivateKey(rsa *rsa.PrivateKey) (*rawJSONWebKey, error) {}

func (key rawJSONWebKey) ecPrivateKey() (*ecdsa.PrivateKey, error) {}

func fromEcPrivateKey(ec *ecdsa.PrivateKey) (*rawJSONWebKey, error) {}

// dSize returns the size in octets for the "d" member of an elliptic curve
// private key.
// The length of this octet string MUST be ceiling(log-base-2(n)/8)
// octets (where n is the order of the curve).
// https://tools.ietf.org/html/rfc7518#section-6.2.2.1
func dSize(curve elliptic.Curve) int {}

func fromSymmetricKey(key []byte) (*rawJSONWebKey, error) {}

func (key rawJSONWebKey) symmetricKey() ([]byte, error) {}