keyutil

package
v0.0.0-...-521784b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2025 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package keyutil provides utility functions for dealing with keys used by the JOSE package for JWT, JWS, JWE, and JWK.

Index

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

func NewSymmetricKey(size int) ([]byte, error)

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

func ParseECDSAPublicKey(r io.Reader) (*ecdsa.PublicKey, error)

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

func ParseEdDSAPublicKey(r io.Reader) (ed25519.PublicKey, error)

ParseEdDSAPublicKey parses the PEM encoded Ed25519 public key from the given reader.

func ParsePrivateKey

func ParsePrivateKey(r io.Reader) (any, error)

ParsePrivateKey parses the PEM encoded private key from the given reader.

func ParsePublicKey

func ParsePublicKey(r io.Reader) (any, error)

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

func ParseRSAPublicKey(r io.Reader) (*rsa.PublicKey, error)

ParseRSAPublicKey parses the PEM encoded RSA public key from the given reader.

func SymmetricKeysEqual

func SymmetricKeysEqual(key1 []byte, key2 []byte) bool

SymmetricKeysEqual checks if the given keys are the same.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL