Documentation ¶
Overview ¶
Package jwtkey provides utility functions for generating, serializing and deserializing JWT ECDSA keys.
TODO: Replace EC function usages with PKCS8 functions for supporting ECDSA and RSA keys instead of only supporting ECDSA. The fact this package only supports ECDSA is unnecessary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GenerateKey() (*ecdsa.PrivateKey, error)
GenerateKey is a convenience function for generating an ECDSA key for use as a JWT key. It uses the P256 curve. To use other curves use the crypto/ecdsa package directly.
func PrivateKeyFromString ¶
func PrivateKeyFromString(s string) (*ecdsa.PrivateKey, error)
PrivateKeyFromString converts a ECDSA private key from a ASN.1 DER and base64 encoded string into a type.
func PrivateKeyToString ¶
func PrivateKeyToString(k *ecdsa.PrivateKey) (string, error)
PrivateKeyToString converts a ECDSA private key into a ASN.1 DER and base64 encoded string.
func PublicKeyFromString ¶
PublicKeyFromString converts a ECDSA public key from a ASN.1 DER and base64 encoded string into a type.
Types ¶
This section is empty.