cloud

package
v0.0.0-...-608cf2c Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCPKMS

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

GCPKMS is a Google Cloud Platform KMS client A wrapper for configuring gcloud, and consuming their KMS service for encrypt/decrypt and key management/acls

func (*GCPKMS) Decrypt

func (gkms *GCPKMS) Decrypt(ciphertext []byte) ([]byte, error)

Decrypt invokes the GCP KMS API to decrypt ciphertext.

func (*GCPKMS) Encrypt

func (gkms *GCPKMS) Encrypt(plaintext []byte) ([]byte, error)

Encrypt invokes GCP KMS to encrypt the data. Returns a bytestream of binary data.

type KMS

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

KMS is a contract interface that must be implemented for sctl to talk to the backing KMS service's two methods of Encrypt and Decrypt, that return byte slices of plaintext/cyphertext respectively and any unwrapped errors that surface from the operation.

func NewGCPKMS

func NewGCPKMS(keyname string) KMS

NewGCPKMS creates a new KMS client for Google Cloud Platform.

Jump to

Keyboard shortcuts

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