gcpcrypt

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gcpcrypt contains a client of GCP Cloud KMS symmetric encryption. GCP Cloud KMS symmetric encryption service is an encryption/decryption service where keys are stored securely on GCP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client of GCP CloudKMS symmetric encryption service. Sensitive data should be encrypted in database. With GCP CloudKMS, we don't need to worry about how to store the key safely. This Client wraps CloudKMS client in common interface, developer can easier support other KMS.

func New

func New(ctx context.Context, projectID, keyRingLocation, keyRingName, keyName string, client *kms.KeyManagementClient) (*Client, error)

New returns Client.

func (*Client) Decrypt

func (s *Client) Decrypt(ctx context.Context, encrypted []byte, additionalAuthData string) ([]byte, error)

Decrypt data with Cloud KMS.

func (*Client) Encrypt

func (s *Client) Encrypt(ctx context.Context, data []byte, additionalAuthData string) ([]byte, error)

Encrypt data with Cloud KMS.

Directories

Path Synopsis
Binary gcpcrypt contains a symmetric encryption test run on real CloudKMS.
Binary gcpcrypt contains a symmetric encryption test run on real CloudKMS.

Jump to

Keyboard shortcuts

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