crypt

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeys

func GenerateKeys(enc EncryptionType, keyPath string) error

Types

type Encrypter

type Encrypter interface {
	Encrypt(plaintext string, key any) (string, error)
	Decrypt(cipherText string, key any) (string, error)
}

type EncryptionType

type EncryptionType string
var (
	ErrUnknownEncryptionType                = errors.New("unknown encryption type")
	AES256                   EncryptionType = "aes256"
	ECC256                   EncryptionType = "ecc256"
	RSA2048                  EncryptionType = "rsa2048"
	Serpent256               EncryptionType = "serpent256"
)

type Keeper

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

func NewKeeper

func NewKeeper(t EncryptionType, keyPath string) (*Keeper, error)

func (*Keeper) Decrypt

func (k *Keeper) Decrypt(secretName, cipher string) (string, error)

func (*Keeper) Encrypt

func (k *Keeper) Encrypt(secretName, plainText string) (string, error)

func (*Keeper) RemoveKey

func (k *Keeper) RemoveKey(secretName string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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