Documentation ¶
Index ¶
- Variables
- func AESDecrypt(key []byte, b64ciphertext string) (string, error)
- func AESEncrypt(key []byte, plaintext string) (string, error)
- func UnparseDecryptParams(decryptParams DecryptParams) string
- type Ciphertext
- type Crypter
- type DecryptParams
- type EncryptParams
- type KMSAPI
- type KMSCrypter
- type LocalCrypter
- type MockCrypter
- type PasswordCrypter
- type PlainCrypter
Constants ¶
This section is empty.
Variables ¶
View Source
var CryptersMap map[string]Crypter
CryptersMap contains a mapping to supported crypters
Functions ¶
func UnparseDecryptParams ¶
func UnparseDecryptParams(decryptParams DecryptParams) string
UnparseDecryptParams parses the URL encoded parameters into a map
Types ¶
type Crypter ¶
type Crypter interface { Name() string Encrypt(string, EncryptParams) (Ciphertext, DecryptParams, error) Decrypt(Ciphertext, DecryptParams) (string, error) }
Crypter is an object that knows how to encrypt and decrypt a secret
type DecryptParams ¶
DecryptParams are parameters used for decrypting a secret
func ParseDecryptParams ¶
func ParseDecryptParams(s string) (DecryptParams, error)
ParseDecryptParams parses the URL encoded parameters into a map
type EncryptParams ¶
EncryptParams are parameters used for encrypting a secret
type KMSCrypter ¶
type KMSCrypter struct{}
func (KMSCrypter) Decrypt ¶
func (c KMSCrypter) Decrypt(ciphertext Ciphertext, decryptParams DecryptParams) (string, error)
func (KMSCrypter) Encrypt ¶
func (c KMSCrypter) Encrypt(plaintext string, encryptParams EncryptParams) (Ciphertext, DecryptParams, error)
func (KMSCrypter) Name ¶
func (c KMSCrypter) Name() string
type LocalCrypter ¶
type LocalCrypter struct{}
func (LocalCrypter) Decrypt ¶
func (c LocalCrypter) Decrypt(b64ciphertext Ciphertext, decryptParams DecryptParams) (string, error)
func (LocalCrypter) Encrypt ¶
func (c LocalCrypter) Encrypt(plaintext string, encryptParams EncryptParams) (Ciphertext, DecryptParams, error)
func (LocalCrypter) Name ¶
func (c LocalCrypter) Name() string
type MockCrypter ¶
func (*MockCrypter) Decrypt ¶
func (_m *MockCrypter) Decrypt(_a0 Ciphertext, _a1 DecryptParams) (string, error)
Decrypt provides a mock function with given fields: _a0, _a1
func (*MockCrypter) Encrypt ¶
func (_m *MockCrypter) Encrypt(_a0 string, _a1 EncryptParams) (Ciphertext, DecryptParams, error)
Encrypt provides a mock function with given fields: _a0, _a1
func (*MockCrypter) Name ¶
func (_m *MockCrypter) Name() string
Name provides a mock function with given fields:
type PasswordCrypter ¶
type PasswordCrypter struct {
// contains filtered or unexported fields
}
func (PasswordCrypter) Decrypt ¶
func (c PasswordCrypter) Decrypt(b64ciphertext Ciphertext, decryptParams DecryptParams) (string, error)
func (PasswordCrypter) Encrypt ¶
func (c PasswordCrypter) Encrypt(plaintext string, encryptParams EncryptParams) (Ciphertext, DecryptParams, error)
func (PasswordCrypter) Name ¶
func (c PasswordCrypter) Name() string
type PlainCrypter ¶
type PlainCrypter struct{}
func (PlainCrypter) Decrypt ¶
func (pc PlainCrypter) Decrypt(myCiphertext Ciphertext, decryptParams DecryptParams) (string, error)
func (PlainCrypter) Encrypt ¶
func (pc PlainCrypter) Encrypt(plaintext string, encryptParams EncryptParams) (Ciphertext, DecryptParams, error)
func (PlainCrypter) Name ¶
func (pc PlainCrypter) Name() string
Click to show internal directories.
Click to hide internal directories.