Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWK ¶
type JWK struct { KeyType string `json:"kty"` // EC, Public Curve string `json:"crv,omitempty"` X string `json:"x,omitempty"` Y string `json:"y,omitempty"` // RSA, Public Modulus string `json:"n,omitempty"` PublicExponent string `json:"e,omitempty"` // EC & RSA, Private D string `json:"d,omitempty"` // RSA, Private Prime1 string `json:"p,omitempty"` Prime2 string `json:"q,omitempty"` Exponent1 string `json:"dp,omitempty"` Exponent2 string `json:"dq,omitempty"` Coefficient string `json:"qi,omitempty"` }
JWK represents a (simplified version of a) JSON Web Key.
func PrivateKeyToJWK ¶
PrivateKeyToJWK converts any private key type created by the crypto x509 package into a JWK. This includes *rsa.PublicKey, *ecdsa.PublicKey, ed25519.PublicKey (not a pointer), and *ecdh.PublicKey.
func PublicKeyToJWK ¶
PublicKeyToJWK converts any public key type created by the crypto x509 package into a JWK. This includes *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey, ed25519.PublicKey (not a pointer), or *ecdh.PublicKey (for X25519).
Source Files ¶
Click to show internal directories.
Click to hide internal directories.