Class BaseProtector
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.crypto.BaseProtector
-
- All Implemented Interfaces:
Protector
- Direct Known Subclasses:
KeyStoreBasedProtectorImpl
public abstract class BaseProtector extends Object implements Protector
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.prism.crypto.Protector
XMLSEC_ENCRYPTION_ALGORITHM_AES128_CBC, XMLSEC_ENCRYPTION_ALGORITHM_AES256_CBC, XMLSEC_ENCRYPTION_NS
-
-
Constructor Summary
Constructors Constructor Description BaseProtector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T> void
decrypt(ProtectedData<T> protectedData)
protected abstract <T> byte[]
decryptBytes(ProtectedData<T> protectedData)
String
decryptString(ProtectedData<String> protectedString)
ProtectedStringType
encryptString(String text)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.prism.crypto.Protector
areEquivalent, compareCleartext, encrypt, getKeyStore, getTrustManagers, hash, isEncryptedByCurrentKey
-
-
-
-
Method Detail
-
decrypt
public <T> void decrypt(ProtectedData<T> protectedData) throws EncryptionException, SchemaException
- Specified by:
decrypt
in interfaceProtector
- Throws:
EncryptionException
SchemaException
-
decryptBytes
protected abstract <T> byte[] decryptBytes(ProtectedData<T> protectedData) throws SchemaException, EncryptionException
- Throws:
SchemaException
EncryptionException
-
decryptString
public String decryptString(ProtectedData<String> protectedString) throws EncryptionException
- Specified by:
decryptString
in interfaceProtector
- Returns:
- decrypted String from protectedString object
- Throws:
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE installed
-
encryptString
public ProtectedStringType encryptString(String text) throws EncryptionException
- Specified by:
encryptString
in interfaceProtector
- Returns:
ProtectedStringType
with encrypted string inside it. If input argument is null or empty, method returns null.- Throws:
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE installed
-
-