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) (any, error)
- func ParsePublicKey(r io.Reader) (any, 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)
NewECDSAKeyPair returns a new ECDSA key pair, or an error if one occurs.
func NewEdDSAKeyPair ¶
func NewEdDSAKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)
NewEdDSAKeyPair returns a new EdDSA key pair, or an error if one occurs.
func NewRSAKeyPair ¶
func NewRSAKeyPair() (*rsa.PublicKey, *rsa.PrivateKey, error)
NewRSAKeyPair returns a new RSA key pair, or an error if one occurs.
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)
ParseEdDSAPrivateKey parses the PEM encoded Ed25519 private key from the given reader.
func ParseEdDSAPublicKey ¶
ParseEdDSAPublicKey parses the PEM encoded Ed25519 public key from the given reader.
func ParsePrivateKey ¶
ParsePrivateKey parses the PEM encoded private key from the given reader.
func ParsePublicKey ¶
ParsePublicKey parses the PEM encoded public key from the given reader.
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.