crypto

package
v0.0.0-...-daa1dba Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyUseSignature string = "sig"
	KeyAlgorithm    string = "RS256"
)

Variables

View Source
var ErrNoPreviousJwkFound = fmt.Errorf("no previous JWK found in secrets")

Functions

func GenerateJwk

func GenerateJwk() (*jose.JSONWebKey, error)

func GenerateJwt

func GenerateJwt(signer jose.Signer, claims interface{}) (string, error)

func GenerateRSAKey

func GenerateRSAKey() (*rsa.PrivateKey, error)

func GetPreviousJwkFromSecret

func GetPreviousJwkFromSecret(managedSecrets *kubernetes.SecretLists, secretKey string) (*jose.JSONWebKey, error)

func MergeJwks

func MergeJwks(jwk jose.JSONWebKey, secretsInUse v1.SecretList, secretKey string) (*jose.JSONWebKeySet, error)

Types

type DigdirJwk

type DigdirJwk struct {
	KeyID  string `json:"kid"`
	Expiry int64  `json:"exp"`
}

func (DigdirJwk) ExpiryTime

func (d DigdirJwk) ExpiryTime() time.Time

type DigdirJwkSet

type DigdirJwkSet struct {
	Keys []DigdirJwk `json:"keys"`
}

func (DigdirJwkSet) KeyIDs

func (d DigdirJwkSet) KeyIDs() []string

Jump to

Keyboard shortcuts

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