encryption

package
v0.0.0-...-75ba6a0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsKmsEncryption

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

func (*AwsKmsEncryption) Decrypt

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

func (*AwsKmsEncryption) Encrypt

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

func (*AwsKmsEncryption) Init

func (a *AwsKmsEncryption) Init(c map[string]string) error

type EncryptionBackend

type EncryptionBackend interface {
	Init(map[string]string) error
	Encrypt([]byte) ([]byte, []byte, error)
	Decrypt([]byte, []byte) ([]byte, error)
}

type NullEncryption

type NullEncryption struct{}

NullEncryption is a dummy encryption backend that does not encrypt or decrypt anything.

func (NullEncryption) Decrypt

func (n NullEncryption) Decrypt(ciphertext []byte, key []byte) ([]byte, error)

Decrypt does not decrypt anything.

func (NullEncryption) Encrypt

func (n NullEncryption) Encrypt(plaintext []byte) ([]byte, []byte, error)

Encrypt does not encrypt anything.

func (NullEncryption) Init

func (n NullEncryption) Init(config map[string]string) error

Init does nothing.

type RsaKeyPair

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

RsaKeyPair is a struct that holds the private and public keys

func (*RsaKeyPair) Decrypt

func (k *RsaKeyPair) Decrypt(data []byte, key []byte) ([]byte, error)

func (*RsaKeyPair) Encrypt

func (k *RsaKeyPair) Encrypt(data []byte) ([]byte, []byte, error)

func (*RsaKeyPair) Init

func (k *RsaKeyPair) Init(config map[string]string) error

Jump to

Keyboard shortcuts

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