Documentation ¶
Overview ¶
Package keyutil provides utility functions for dealing with keys used by the JOSE package for JWT, JWS, JWE, and JWK.
Index ¶
- func NewECDSAKeyPair() (*ecdsa.PublicKey, *ecdsa.PrivateKey, error)
- func NewEdDSAKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func NewRSAKeyPair() (*rsa.PublicKey, *rsa.PrivateKey, error)
- func NewSymmetricKey(size int) ([]byte, error)
- func ParseECDSAPrivateKey(r io.Reader) (*ecdsa.PrivateKey, error)
- func ParseECDSAPublicKey(r io.Reader) (*ecdsa.PublicKey, error)
- func ParseEdDSAPrivateKey(r io.Reader) (ed25519.PrivateKey, error)
- func ParseEdDSAPublicKey(r io.Reader) (ed25519.PublicKey, error)
- func ParsePrivateKey(r io.Reader) (interface{}, error)
- func ParsePublicKey(r io.Reader) (interface{}, error)
- func ParseRSAPrivateKey(r io.Reader) (*rsa.PrivateKey, error)
- func ParseRSAPublicKey(r io.Reader) (*rsa.PublicKey, error)
- func SymmetricKeysEqual(key1 []byte, key2 []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewECDSAKeyPair ¶
func NewECDSAKeyPair() (*ecdsa.PublicKey, *ecdsa.PrivateKey, error)
func NewEdDSAKeyPair ¶
func NewEdDSAKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
func NewRSAKeyPair ¶
func NewRSAKeyPair() (*rsa.PublicKey, *rsa.PrivateKey, error)
func NewSymmetricKey ¶
NewSymmetricKey generates a new symmetric key of the given size.
func ParseECDSAPrivateKey ¶
func ParseECDSAPrivateKey(r io.Reader) (*ecdsa.PrivateKey, error)
ParseECDSAPrivateKey parses the PEM encoded ECDSA private key from the given reader.
func ParseECDSAPublicKey ¶
ParseECDSAPublicKey parses the PEM encoded ECDSA public key from the given reader.
func ParseEdDSAPrivateKey ¶
func ParseEdDSAPrivateKey(r io.Reader) (ed25519.PrivateKey, error)
func ParsePrivateKey ¶
func ParsePublicKey ¶
func ParseRSAPrivateKey ¶
func ParseRSAPrivateKey(r io.Reader) (*rsa.PrivateKey, error)
ParseRSAPrivateKey parses the PEM encoded RSA private key from the given reader.
func ParseRSAPublicKey ¶
ParseRSAPublicKey parses the PEM encoded RSA public key from the given reader.
func SymmetricKeysEqual ¶
SymmetricKeysEqual checks if the given keys are the same.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.