crypto

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TemplateFunctions added in v0.0.5

func TemplateFunctions() template.FuncMap

TemplateFunctions provides template functions for render or the standard (text/template) template engine

  • encryptAWS - encrypts the data from inside of the template using AWS KMS, for best results use with gzip and b64enc
  • decryptAWS - decrypts the data from inside of the template using AWS KMS, for best results use with ungzip and b64dec
  • encryptGCP - encrypts the data from inside of the template using GCP KMS, for best results use with gzip and b64enc
  • decryptGCP - decrypts the data from inside of the template using GCP KMS, for best results use with ungzip and b64dec
  • encryptAzure - encrypts the data from inside of the template using Azure Key Vault, for best results use with gzip and b64enc
  • decryptAzure - decrypts the data from inside of the template using Azure Key Vault, for best results use with ungzip and b64dec

Types

type Crypt

type Crypt interface {
	KMS
	EncryptFile(inputPath, outputPath string) error
	DecryptFile(inputPath, outputPath string) error
}

Crypt is an abstraction for encryption and decryption with files support

func New added in v0.0.4

func New(kms KMS) Crypt

New creates a new Crypt with the given provider

type KMS

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

KMS (Key Management Service) is a common abstraction for encryption and decryption. A KMS must be able to decrypt the data it encrypts.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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