Documentation
¶
Overview ¶
Package jwk provides JSON Web Key (JWK) structure and methods to decode it to public and private keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
Alg string `json:"alg"` // algorithm
Crv string `json:"crv,omitempty"` // curve - for EC keys
D string `json:"d"` // private exponent
DP string `json:"dp"` // d mod (p-1)
DQ string `json:"dq"` // d mod (p-1)
E string `json:"e"` // public exponent
K string `json:"k,omitempty"` // symmetric key
Kid string `json:"kid"` // Key ID
Kty string `json:"kty"` // Key Type
N string `json:"n"` // modulus
P string `json:"p"` // prime factor 1
Q string `json:"q"` // prime factor 2
QI string `json:"qi"` // q^(-1) mod p
Use string `json:"use"`
X string `json:"x,omitempty"` // x coordinate - for EC keys
Y string `json:"y,omitempty"` // y coordinate - for EC keys
}
Key defines JSON Web Key structure.
func (*Key) DecodePrivateKey ¶
func (j *Key) DecodePrivateKey() (crypto.PrivateKey, error)
DecodePrivateKey decodes Key to private key.
Click to show internal directories.
Click to hide internal directories.