keys

package
v0.2.46 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PrivateKeySecretKey = "private-key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyPair

type KeyPair struct {
	ActiveKey bool
	KeyId     string
	Private   crypto.Signer
}

func LoadKeyFromPEM

func LoadKeyFromPEM(privateKeyPEM []byte) (*KeyPair, error)

LoadKeyFromPEM loads a private key from a PEM encoded private key.

func LoadKeysFromSecret

func LoadKeysFromSecret(secret *corev1.Secret, isActive bool) (*KeyPair, error)

LoadKeysFromSecret loads an key pair from a Kubernetes Secret.

type KeyPairs

type KeyPairs []*KeyPair

func GenerateECDSAKeyPair

func GenerateECDSAKeyPair() *KeyPairs

GenerateECDSAKeyPair generates a new ECDSA key pair for JWT signing.

func GenerateRSAKeyPair

func GenerateRSAKeyPair() *KeyPairs

func LoadOrGenerateKeyPair

func LoadOrGenerateKeyPair(
	secrets kdexv1alpha1.Secrets,
	devMode bool,
) (*KeyPairs, error)

LoadOrGenerateKeyPair loads a key pair from a Kubernetes Secret. If the secret doesn't exist or is invalid, it generates a new key pair.

func (*KeyPairs) ActiveKey

func (p *KeyPairs) ActiveKey() *KeyPair

Jump to

Keyboard shortcuts

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