Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Ciphers = &ciphersEnum{
Mock: "MOCK",
Aes: "AES",
}
Ciphers enumerates the supported Cipher types
Functions ¶
This section is empty.
Types ¶
type AesCipher ¶
type AesCipher struct { }
AesCipher implements a Cipher service with AES encryption
func (*AesCipher) PrepareKey ¶
PrepareKey transforms the key into AesCipher format
type Cipher ¶
type Cipher interface { Type() Type PrepareKey(key string) ([]byte, error) Encrypt(data []byte, key []byte) ([]byte, error) Decrypt(data []byte, key []byte) ([]byte, error) // contains filtered or unexported methods }
Cipher is a component to interact with the different Cipher services
type MockCipher ¶
MockCipher mocks a Cipher service
func NewMockCipher ¶
func NewMockCipher() *MockCipher
NewMockCipher creates an instance of MockCipher
func (*MockCipher) Decrypt ¶
func (m *MockCipher) Decrypt(data []byte, key []byte) ([]byte, error)
Decrypt mocks Decrypt function
func (*MockCipher) Encrypt ¶
func (m *MockCipher) Encrypt(data []byte, key []byte) ([]byte, error)
Encrypt mocks Encrypt function
func (*MockCipher) PrepareKey ¶
func (m *MockCipher) PrepareKey(key string) ([]byte, error)
PrepareKey mocks PrepareKey function
Click to show internal directories.
Click to hide internal directories.