gcp

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrProjectMissing - this is the custom error, returned when project is missing
	ErrProjectMissing = errors.New("project is empty or missing")
	// ErrLocationMissing = this is the custom error, returned when the location is missing
	ErrLocationMissing = errors.New("location is empty or missing")
	// ErrKeyRingMissing = this is the custom error, returned when the key ring is missing
	ErrKeyRingMissing = errors.New("key ring is empty or missing")
	// ErrKeyMissing = this is the custom error, returned when the key is missing
	ErrKeyMissing = errors.New("key is empty or missing")
)

Functions

This section is empty.

Types

type GoogleKMS

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

GoogleKMS provides a way to encrypt and decrypt the data using GCP KMS.

func NewGoogleKMS

func NewGoogleKMS(project, location, keyring, key string) *GoogleKMS

NewGoogleKMS new GCP KMS

func (*GoogleKMS) Decrypt

func (g *GoogleKMS) Decrypt(ciphertext []byte) ([]byte, error)

Decrypt is responsible for decrypting ciphertext and returning plaintext in bytes using GCP KMS. See Crypt.DecryptFile

func (*GoogleKMS) Encrypt

func (g *GoogleKMS) Encrypt(plaintext []byte) ([]byte, error)

Encrypt is responsible for encrypting plaintext and returning ciphertext in bytes using GCP KMS. See Crypt.EncryptFile

Jump to

Keyboard shortcuts

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