encryption

package
v0.0.0-...-4710560 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const FakeESType = "Fake"
View Source
const GCPKMSESType = "GCP_KMS" // GCP's KMS service.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type   string
	GCPKMS *GCPKMSConfig
}

type FakeEncryptionService

type FakeEncryptionService struct{}

A simple and very insecure implementation of an encryption service to be used for testing and local development.

func NewFakeEncryptionService

func NewFakeEncryptionService() *FakeEncryptionService

func (*FakeEncryptionService) Decrypt

func (es *FakeEncryptionService) Decrypt(ciphertext []byte) ([]byte, error)

func (*FakeEncryptionService) Encrypt

func (es *FakeEncryptionService) Encrypt(plaintext []byte) ([]byte, error)

type GCPKMSConfig

type GCPKMSConfig struct {
	KeyName string
}

type GCPKMSEncryptionService

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

func NewGCPKMSEncryptionService

func NewGCPKMSEncryptionService(keyName string) *GCPKMSEncryptionService

func (*GCPKMSEncryptionService) Decrypt

func (s *GCPKMSEncryptionService) Decrypt(ciphertext []byte) ([]byte, error)

func (*GCPKMSEncryptionService) Encrypt

func (s *GCPKMSEncryptionService) Encrypt(plaintext []byte) ([]byte, error)

type Service

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

Jump to

Keyboard shortcuts

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