setup

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package setup provides functions to create a KMS and key store from a given URI.

This package does not provide any functionality to interact with the KMS or key store, but only to create them.

Adding support for a new KMS or storage backend requires adding a new URI for that backend, and implementing the corresponding get*Config function.

Index

Constants

View Source
const (
	AWSKMSURI     = "kms://aws?keyPolicy=%s&kekID=%s"
	AzureKMSURI   = "kms://azure-kms?name=%s&type=%s&kekID=%s"
	AzureHSMURI   = "kms://azure-hsm?name=%s&kekID=%s"
	GCPKMSURI     = "kms://gcp?project=%s&location=%s&keyRing=%s&protectionLvl=%s&kekID=%s"
	ClusterKMSURI = "kms://cluster-kms?key=%s&salt=%s"
	AWSS3URI      = "storage://aws?bucket=%s"
	AzureBlobURI  = "storage://azure?container=%s&connectionString=%s"
	GCPStorageURI = "storage://gcp?projects=%s&bucket=%s"
	NoStoreURI    = "storage://no-store"
)

Well known endpoints for KMS services.

Variables

This section is empty.

Functions

func KMS

func KMS(ctx context.Context, storageURI, kmsURI string) (kms.CloudKMS, error)

KMS creates a KMS and key store from the given parameters.

Types

type KMSInformation

type KMSInformation struct {
	KMSURI             string
	StorageURI         string
	KeyEncryptionKeyID string
}

KMSInformation about an existing KMS.

type MasterSecret

type MasterSecret struct {
	Key  []byte `json:"key"`
	Salt []byte `json:"salt"`
}

MasterSecret holds the master key and salt for deriving keys.

func (*MasterSecret) EncodeToURI

func (m *MasterSecret) EncodeToURI() string

EncodeToURI returns an URI encoding the master secret.

Jump to

Keyboard shortcuts

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