Documentation ¶
Index ¶
- type KmsDecrypter
- func (d *KmsDecrypter) DecryptEnv(m string) (map[string]string, error)
- func (d *KmsDecrypter) DecryptEnvAuto() map[string]string
- func (d *KmsDecrypter) DecryptMap(m map[string]string) (map[string]string, error)
- func (d *KmsDecrypter) DecryptString(s string) (string, error)
- func (d *KmsDecrypter) DecryptStringSlice(s []string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KmsDecrypter ¶
type KmsDecrypter struct {
// contains filtered or unexported fields
}
KmsDecrypter stores the AWS Session used for KMS decryption.
func New ¶
func New(r string) (*KmsDecrypter, error)
New takes AWS Region r and creates a KmsDecrypter. Returns new KmsDecrypter and error.
func (*KmsDecrypter) DecryptEnv ¶
func (d *KmsDecrypter) DecryptEnv(m string) (map[string]string, error)
DecryptEnv will return a map[string]string decrypted Key-Value pairs from ENV variables that includes the supplied Marker m in it's Key. If m is an empty string it will default to "KMS_DECRYPT". The returned maps Key will have the marker removed from it's Key-name. Returns map[string]string and error.
func (*KmsDecrypter) DecryptEnvAuto ¶
func (d *KmsDecrypter) DecryptEnvAuto() map[string]string
DecryptEnvAuto will decrypt values from ENV variables automatically. It will check that the ENV value is divisible by 4, otherwise the ENV vill be ignored. Please note that any KMS decryption error will be treated as the ENV was not encrypted. So it can potentially be dangeroud, so use with causion. Returns a map[string]string of decrypted Key-Value pairs.
func (*KmsDecrypter) DecryptMap ¶
DecryptMap will decrypt values from map[string]string m. Returns a map[string]string of decrypted Key-Value pairs.
func (*KmsDecrypter) DecryptString ¶
func (d *KmsDecrypter) DecryptString(s string) (string, error)
DecryptString will string s. Returns a decrypted string.
func (*KmsDecrypter) DecryptStringSlice ¶
func (d *KmsDecrypter) DecryptStringSlice(s []string) ([]string, error)
DecryptStringSlice will decrypt values from []string s. Returns a []string of decrypted strings.