Package org.wso2.securevault
Class BaseCipher
java.lang.Object
org.wso2.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, EncryptionKeyWrapper encryptionKeyWrapper) protectedBaseCipher(CipherInformation cipherInformation, KeyStoreWrapper keyStoreWrapper) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(byte[] cipherText) Decrypts input cipher bytes.byte[]decrypt(byte[] cipherText, AlgorithmParameterSpec params) Decrypts input cipher bytes.byte[]encrypt(byte[] plainText) Encrypts a plain text.abstract KeygetKey(CipherOperationMode operationMode) Returns the correct key for correct operation
-
Field Details
-
keyStoreWrapper
-
-
Constructor Details
-
BaseCipher
-
BaseCipher
-
BaseCipher
protected BaseCipher(CipherInformation cipherInformation, EncryptionKeyWrapper encryptionKeyWrapper) -
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) Encrypts a plain text.- Specified by:
encryptin interfaceEncryptionProvider- Parameters:
plainText- Plain text as a byte array.- Returns:
- Cipher text as a byte array.
-
decrypt
public byte[] decrypt(byte[] cipherText) Decrypts input cipher bytes.- Specified by:
decryptin interfaceDecryptionProvider- Parameters:
cipherText- Encrypted text as a byte array.- Returns:
- Plain text as byte array.
-
decrypt
Decrypts input cipher bytes.- Specified by:
decryptin interfaceDecryptionProvider- Parameters:
cipherText- Encrypted text as a byte array.params- The algorithm parameters.- Returns:
- Plain text as byte array.
-