Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPublic = errors.New("public key")
ErrPublic is returned if no private part is present in the JWK
Functions ¶
This section is empty.
Types ¶
type JWK ¶
type JWK struct { KeyType string `json:"kty"` PublicKeyUse string `json:"use,omitempty"` KeyOperations []string `json:"key_ops,omitempty"` Algorithm string `json:"alg,omitempty"` KeyID string `json:"kid,omitempty"` X509URL string `json:"x5u,omitempty"` X509CertificateThumbprint string `json:"x5t,omitempty"` X509CertificateSHA256Thumbprint string `json:"x5t#S256,omitempty"` X509CertificateChain []string `json:"x5c,omitempty"` // Parameters for Elliptic Curve Keys Curve string `json:"crv,omitempty"` X string `json:"x,omitempty"` Y string `json:"y,omitempty"` // Parameters for RSA Keys N string `json:"n,omitempty"` E string `json:"e,omitempty"` P string `json:"p,omitempty"` Q string `json:"q,omitempty"` Dp string `json:"dp,omitempty"` Dq string `json:"dq,omitempty"` Qi string `json:"qi,omitempty"` Oth []*RSAPrime `json:"oth,omitempty"` // Same name, different meaning for EC and RSA D string `json:"d,omitempty"` // Symmetric K string `json:"k,omitempty"` // Microsoft extension? KeyHSM string `json:"key_hsm,omitempty"` }
JWK represents a A JSON Web Key see https://tools.ietf.org/html/rfc7517
func EncodePrivateKey ¶
func EncodePrivateKey(key crypto.PrivateKey) (jwk *JWK, err error)
EncodePrivateKey returns a JWT populated with data from the private key
func EncodePublicKey ¶
EncodePublicKey returns a JWT populated with data from the private key
func (*JWK) PrivateKey ¶
func (j *JWK) PrivateKey() (crypto.PrivateKey, error)
PrivateKey decodes a private key represented in JWK
Click to show internal directories.
Click to hide internal directories.