decrypt

package
v0.7.1 Latest Latest
Warning

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

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

Documentation

Overview

Package decrypt loads encrypted keys from Google KMS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Project string
	Region  string
	Keyring string
	Key     string
}

Config contains settings for KMS decryption.

func NewConfig

func NewConfig(project, region, keyring, key string) *Config

NewConfig creates a new signer config.

func (*Config) Load

func (c *Config) Load(ctx context.Context, client Decrypter, ciphertext string) ([]byte, error)

Load decrypts the ciphertext using the given KMS keypath and returns the decrypted plain text as bytes.

func (*Config) LoadSigner

func (c *Config) LoadSigner(ctx context.Context, client Decrypter, ciphertext string) (*token.Signer, error)

LoadSigner decryptes the given ciphertext and uses it to initialize a token Signer.

func (*Config) LoadVerifier

func (c *Config) LoadVerifier(ctx context.Context, client Decrypter, ciphertext ...string) (*token.Verifier, error)

LoadVerifier decryptes the given ciphertext and uses it to initialize a token Verifier.

type Decrypter

type Decrypter interface {
	Decrypt(ctx context.Context, req *kmspb.DecryptRequest, opts ...gax.CallOption) (*kmspb.DecryptResponse, error)
}

Decrypter wraps the Decrypt operation provided by the kms.KeyManagementClient.

Jump to

Keyboard shortcuts

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