crypto

package
v0.0.0-...-86c6960 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const GpgBin = "gpg"

Variables

This section is empty.

Functions

func GetPubRingArmor

func GetPubRingArmor(keyID string) ([]byte, error)

TODO : unit tests Here we read armored version of Key by calling GPG process

func GetSecretRingArmor

func GetSecretRingArmor(keyID string) ([]byte, error)

Types

type CachedKey

type CachedKey struct {
	KeyID string `json:"keyId"`
	Body  []byte `json:"body"`
}

CachedKey is the data transfer object describing format of key ring cache

type Crypter

type Crypter interface {
	Name() string
	Encrypt(writer io.Writer) (io.WriteCloser, error)
	Decrypt(reader io.Reader) (io.Reader, error)
}

Crypter is responsible for making cryptographical pipeline parts when needed

type GpgKeyExportError

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

func NewGpgKeyExportError

func NewGpgKeyExportError(text string) GpgKeyExportError

func (GpgKeyExportError) Error

func (err GpgKeyExportError) Error() string

type SymmetricKey

type SymmetricKey interface {
	Generate() error
	Encrypt() error
	Decrypt() error
	GetKey() []byte
	SetKey([]byte) error
	GetEncryptedKey() []byte
	SetEncryptedKey([]byte) error
	GetKeyID() string
	GetEncryptedKeyLen() int
	GetKeyLen() int
}

SymmetricKey encryption interface Used by AWS KMS Crypter When implement another crypters, can be moved to crypto package

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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