crypto

package
v0.0.0-...-35ec390 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashFile

func HashFile(fileName string) (string, error)

HashFile calclates checksun for a file

Types

type Provider

type Provider interface {
	EncryptFile(string, string) error
	DecryptFile(string, string) error
	GetEncryptionKey() (encryptionKey *openpgp.Entity, err error)
	GetSigningKey() (signingKey *openpgp.Entity, err error)
}

Provider helper functions to encrypt/decrypt files

func NewProvider

func NewProvider(config ProviderConfig, log *log.Entry) Provider

NewProvider returns a Crypto Provider

type ProviderConfig

type ProviderConfig struct {
	EncryptionKey         string `json:"encryptionKey"`
	SigningKey            string `json:"signingKey"`
	SigningKeyPassword    string `json:"signingKeyPassword"`
	SigningFingerPrint    string `json:"signingFingerPrint"`
	FingerPrint           string `json:"fingerprint"`
	EncryptionKeyPassword string `json:"encryptionKeyPassword"`
	DecryptionKey         string `json:"decryptionKey"`
	SrcDir                string `json:"srcDir"`
	DestDir               string `json:"destDir"`
	Enabled               bool   `json:"enabled"`
}

ProviderConfig is an instance of the SFTP Connection Details

Jump to

Keyboard shortcuts

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