encryption

package
v0.0.0-...-8ded91f Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptionManager

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

EncryptionManager implements AES-GCM encryption.

func NewEncryptionManager

func NewEncryptionManager(fileClient file.FileOperations) *EncryptionManager

NewEncryptionManager creates a new EncryptionManager instance.

func (*EncryptionManager) Decrypt

func (a *EncryptionManager) Decrypt(ciphertext []byte) ([]byte, error)

Decrypt decrypts ciphertext using AES-GCM.

func (*EncryptionManager) Encrypt

func (a *EncryptionManager) Encrypt(plaintext []byte) ([]byte, error)

Encrypt encrypts plaintext using AES-GCM.

func (*EncryptionManager) Initialize

func (a *EncryptionManager) Initialize(AESKeyPath string) error

Initialize loads and caches the AES key and cipher.

type EncryptionManagerInterface

type EncryptionManagerInterface interface {
	Encrypt(plaintext []byte) ([]byte, error)
	Decrypt(ciphertext []byte) ([]byte, error)
}

EncryptionManagerInterface defines encryption and decryption methods.

Jump to

Keyboard shortcuts

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