public abstract class BaseCipher extends Object implements EncryptionProvider, DecryptionProvider
| Modifier and Type | Field and Description |
|---|---|
protected KeyStoreWrapper |
keyStoreWrapper |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseCipher(CipherInformation cipherInformation,
EncryptionKeyWrapper encryptionKeyWrapper) |
protected |
BaseCipher(CipherInformation cipherInformation,
Key key) |
protected |
BaseCipher(CipherInformation cipherInformation,
KeyStoreInformation keystoreInformation) |
protected |
BaseCipher(CipherInformation cipherInformation,
KeyStoreWrapper keyStoreWrapper) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
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.
|
CipherInformation |
getCipherInformation() |
abstract Key |
getKey(CipherOperationMode operationMode)
Returns the correct key for correct operation
|
KeyStoreInformation |
getKeyStoreInformation() |
protected KeyStoreWrapper keyStoreWrapper
protected BaseCipher(CipherInformation cipherInformation, KeyStoreInformation keystoreInformation)
protected BaseCipher(CipherInformation cipherInformation, KeyStoreWrapper keyStoreWrapper)
protected BaseCipher(CipherInformation cipherInformation, EncryptionKeyWrapper encryptionKeyWrapper)
protected BaseCipher(CipherInformation cipherInformation, Key key)
public CipherInformation getCipherInformation()
public KeyStoreInformation getKeyStoreInformation()
public abstract Key getKey(CipherOperationMode operationMode)
operationMode - Ciper operationpublic byte[] encrypt(byte[] plainText)
encrypt in interface EncryptionProviderplainText - Plain text as a byte array.public byte[] decrypt(byte[] cipherText)
decrypt in interface DecryptionProvidercipherText - Encrypted text as a byte array.public byte[] decrypt(byte[] cipherText,
AlgorithmParameterSpec params)
decrypt in interface DecryptionProvidercipherText - Encrypted text as a byte array.params - The algorithm parameters.Copyright © 2026 WSO2. All rights reserved.