Documentation ¶
Overview ¶
Package cloudkms contains utilities for communicating with CloudKMS.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnwrapShare ¶
UnwrapShare uses a KMS client to unwrap the given share using Cloud KMS.
Types ¶
type Client ¶
type Client interface { GetCryptoKey(context.Context, *spb.GetCryptoKeyRequest, ...gax.CallOption) (*rpb.CryptoKey, error) Encrypt(context.Context, *spb.EncryptRequest, ...gax.CallOption) (*spb.EncryptResponse, error) Decrypt(context.Context, *spb.DecryptRequest, ...gax.CallOption) (*spb.DecryptResponse, error) Close() error }
Client defines an interface compatible with Cloud KMS client.
type ClientFactory ¶
type ClientFactory struct { CredsMap map[string]Client StetVersion string // contains filtered or unexported fields }
ClientFactory manages singleton instances of KMS Clients mapped to JSON credentials.
func NewClientFactory ¶
func NewClientFactory(version string) *ClientFactory
NewClientFactory initializes a ClientMap with the provided version.
func (*ClientFactory) Client ¶
Client returns a KMS Client initialized with the provided credentials. If a client with these credentials already exists, it returns that.
func (*ClientFactory) Close ¶
func (m *ClientFactory) Close() error
Close iterates through all the clients in the map and closes them.
Click to show internal directories.
Click to hide internal directories.