Documentation
¶
Index ¶
- type EncryptionService
- func (es *EncryptionService) Decrypt(ciphertext string) (string, error)
- func (es *EncryptionService) DecryptBytes(ciphertext []byte) ([]byte, error)
- func (es *EncryptionService) DecryptConfigurationValues(config map[string]interface{}, secretFields []string) (map[string]interface{}, error)
- func (es *EncryptionService) Encrypt(plaintext string) (string, error)
- func (es *EncryptionService) EncryptBytes(plaintext []byte) ([]byte, error)
- func (es *EncryptionService) EncryptConfigurationValues(config map[string]interface{}, secretFields []string) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptionService ¶
type EncryptionService struct {
// contains filtered or unexported fields
}
EncryptionService provides encryption and decryption for sensitive configuration values
func NewEncryptionService ¶
func NewEncryptionService(passphrase string) *EncryptionService
NewEncryptionService creates a new encryption service with a PBKDF2-hardened passphrase.
func (*EncryptionService) Decrypt ¶
func (es *EncryptionService) Decrypt(ciphertext string) (string, error)
Decrypt decrypts a base64-encoded ciphertext and returns the plaintext
func (*EncryptionService) DecryptBytes ¶
func (es *EncryptionService) DecryptBytes(ciphertext []byte) ([]byte, error)
DecryptBytes decrypts versioned ciphertext bytes and returns the plaintext bytes.
func (*EncryptionService) DecryptConfigurationValues ¶
func (es *EncryptionService) DecryptConfigurationValues(config map[string]interface{}, secretFields []string) (map[string]interface{}, error)
DecryptConfigurationValues decrypts sensitive values in a configuration map
func (*EncryptionService) Encrypt ¶
func (es *EncryptionService) Encrypt(plaintext string) (string, error)
Encrypt encrypts a plaintext string and returns a versioned, base64-encoded ciphertext.
func (*EncryptionService) EncryptBytes ¶
func (es *EncryptionService) EncryptBytes(plaintext []byte) ([]byte, error)
EncryptBytes encrypts raw bytes and returns the versioned ciphertext bytes.
func (*EncryptionService) EncryptConfigurationValues ¶
func (es *EncryptionService) EncryptConfigurationValues(config map[string]interface{}, secretFields []string) (map[string]interface{}, error)
EncryptConfigurationValues encrypts sensitive values in a configuration map