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> voiddecrypt(ProtectedData<T> protectedData)protected abstract <T> byte[]decryptBytes(ProtectedData<T> protectedData)StringdecryptString(ProtectedData<String> protectedString)ProtectedStringTypeencryptString(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:
decryptin interfaceProtector- Throws:
EncryptionExceptionSchemaException
-
decryptBytes
protected abstract <T> byte[] decryptBytes(ProtectedData<T> protectedData) throws SchemaException, EncryptionException
- Throws:
SchemaExceptionEncryptionException
-
decryptString
public String decryptString(ProtectedData<String> protectedString) throws EncryptionException
- Specified by:
decryptStringin 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:
encryptStringin interfaceProtector- Returns:
ProtectedStringTypewith 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
-
-