crypto

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckOrGenerateJwtSecret

func CheckOrGenerateJwtSecret(jwtSecret string) []byte

CheckOrGenerateJwtSecret verifies a secret exists or generates a random one

func Decrypt

func Decrypt(ciphertext string) (string, error)

Decrypt decrypts a base64 encoded ciphertext string using AES-GCM

func Encrypt

func Encrypt(plaintext string) (string, error)

Encrypt encrypts a plaintext string using AES-GCM

func EvalMatch

func EvalMatch(v any, want []string) bool

EvalMatch checks if a claim matches any of the desired values

func GetBoolClaim

func GetBoolClaim(m map[string]any, key string) bool

GetBoolClaim extracts a boolean claim from a map

func GetByPath

func GetByPath(m map[string]any, path string) (any, bool)

GetByPath extracts a value from a nested map using a dot-separated path

func GetStringClaim

func GetStringClaim(m map[string]any, key string) string

GetStringClaim extracts a string claim from a map

func GetStringSliceClaim

func GetStringSliceClaim(m map[string]any, key string) []string

GetStringSliceClaim extracts a string slice claim from a map

func InitEncryption

func InitEncryption(cfg *config.Config)

InitEncryption initializes the global encryption key based on configuration

func ParseJWTClaims

func ParseJWTClaims(idToken string) map[string]any

ParseJWTClaims decodes and unmarshals the payload part of a JWT

Types

This section is empty.

Jump to

Keyboard shortcuts

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