encryption

package
v0.0.0-...-9d9242c Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJWTSecret

func IsJWTSecret(key string) bool

IsJWTSecret checks if a key should be encrypted with master key (JWT secret only)

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides encryption and decryption functionality

func NewService

func NewService(dbPath string) *Service

NewService creates encryption service with only master key (for JWT secret bootstrap)

func NewServiceWithJwtLey

func NewServiceWithJwtLey(dbPath string, jwtSecret string) *Service

NewServiceWithJwtLey creates a new encryption service with master key derived from database path

func (*Service) DecryptWithJWT

func (s *Service) DecryptWithJWT(ciphertext string) (string, error)

DecryptWithJWT decrypts data using JWT-derived key (for other secrets)

func (*Service) DecryptWithMaster

func (s *Service) DecryptWithMaster(ciphertext string) (string, error)

DecryptWithMaster decrypts data using master key (for JWT secret)

func (*Service) EncryptWithJWT

func (s *Service) EncryptWithJWT(plaintext string) (string, error)

EncryptWithJWT encrypts data using JWT-derived key (for other secrets)

func (*Service) EncryptWithMaster

func (s *Service) EncryptWithMaster(plaintext string) (string, error)

EncryptWithMaster encrypts data using master key (for JWT secret)

func (*Service) SetJWTKey

func (s *Service) SetJWTKey(jwtSecret string)

SetJWTKey sets the JWT key after it's been loaded/generated

Jump to

Keyboard shortcuts

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