Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenLocal ¶
OpenLocal returns an inmemory Keeper based on a provided key.
The scheme for the base64 key should look like: 'base64key://' The URL hostname must be a base64-encoded key, of length 32 bytes when decoded.
func OpenSecretKeeper ¶
func OpenSecretKeeper(ctx context.Context, path, cloudProvider string, localBase64Key string) (*secrets.Keeper, error)
OpenSecretKeeper returns a Go Cloud Development Kit (Go CDK) Keeper object which can be used to encrypt and decrypt byte slices and stored in various services. Checkout https://gocloud.dev/ref/secrets/ for more details.
Types ¶
type StringKeeper ¶
type StringKeeper struct {
// contains filtered or unexported fields
}
StringKeeper wraps a secrets.Keeper but accepts and returns strings, which are easier to store in a database or pass around. Encrypted and decryptable values must be in base64.StdEncoding format.
func NewStringKeeper ¶
func NewStringKeeper(keeper *secrets.Keeper, timeout time.Duration) *StringKeeper
func TestStringKeeper ¶
func TestStringKeeper(t *testing.T) *StringKeeper
func (*StringKeeper) Close ¶
func (str *StringKeeper) Close() error
func (*StringKeeper) DecryptString ¶
func (str *StringKeeper) DecryptString(in string) (string, error)
DecryptString accepts a base64.StdEncoding string and returns the plaintext decrypted version
func (*StringKeeper) EncryptString ¶
func (str *StringKeeper) EncryptString(in string) (string, error)
EncryptString accepts a string a returns the base64.StdEncoding encoding of its encrypted contents