Package org.apache.synapse.securevault
Class BaseCipher
java.lang.Object
org.apache.synapse.securevault.BaseCipher
- All Implemented Interfaces:
DecryptionProvider,EncryptionProvider
- Direct Known Subclasses:
AsymmetricCipher,SymmetricCipher
Wraps the cipher and expose abstraction need for synapse ciphering
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseCipher(CipherInformation cipherInformation, Key key) protectedBaseCipher(CipherInformation cipherInformation, KeyStoreInformation keystoreInformation) protectedBaseCipher(CipherInformation cipherInformation, KeyStoreWrapper keyStoreWrapper) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(byte[] cipherText) Decrypts input cipher bytesbyte[]encrypt(byte[] plainText) Encrypts a plain textabstract KeygetKey(CipherOperationMode operationMode) Returns the correct key for correct operation
-
Field Details
-
keyStoreWrapper
-
-
Constructor Details
-
BaseCipher
-
BaseCipher
-
BaseCipher
-
-
Method Details
-
getCipherInformation
-
getKeyStoreInformation
-
getKey
Returns the correct key for correct operation- Parameters:
operationMode- Ciper operation- Returns:
- A key
-
encrypt
public byte[] encrypt(byte[] plainText) Description copied from interface:EncryptionProviderEncrypts a plain text- Specified by:
encryptin interfaceEncryptionProvider- Parameters:
plainText- as a byte array- Returns:
- cipher text as a byte array
-
decrypt
public byte[] decrypt(byte[] cipherText) Description copied from interface:DecryptionProviderDecrypts input cipher bytes- Specified by:
decryptin interfaceDecryptionProvider- Parameters:
cipherText- as a byte array- Returns:
- plain text as byte array
-