encryption_service

package module
v0.0.0-...-57a80da Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptionOutPut

type EncryptionOutPut struct {
	Data  []byte
	Nonce []byte
}

type EncryptionService

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

func (*EncryptionService) DecryptData

func (e *EncryptionService) DecryptData(data []byte, nonce []byte) ([]byte, error)

DecryptData decrypts the data using AES-GCM, the nonce needs to be provided

func (*EncryptionService) EncryptData

func (e *EncryptionService) EncryptData(data []byte) (EncryptionOutPut, error)

EncryptData encrypts the data using AES-GCM, the nonce is generated using the crypto/rand package

type IEncryptionService

type IEncryptionService interface {
	EncryptData(data []byte) (EncryptionOutPut, error)
	DecryptData(data []byte, nonce []byte) ([]byte, error)
}

func NewEncryptionServiceFromKey

func NewEncryptionServiceFromKey(keyAsBytes []byte) IEncryptionService

Jump to

Keyboard shortcuts

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