|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.evolveum.midpoint.common.crypto.AESProtector
public class AESProtector
Class that manages encrypted string values. Java Cryptography Extension is needed because this class is using AES-256 for encrypting/decrypting xml data.
Constructor Summary | |
---|---|
AESProtector()
|
Method Summary | |
---|---|
org.w3c.dom.Element |
decrypt(ProtectedStringType protectedString)
|
java.lang.String |
decryptString(ProtectedStringType protectedString)
|
ProtectedStringType |
encrypt(org.w3c.dom.Element plain)
|
void |
encrypt(ProtectedStringType ps)
Encrypts the ProtectedStringType "in place". |
ProtectedStringType |
encryptString(java.lang.String text)
|
PrismContext |
getPrismContext()
|
java.util.List<javax.net.ssl.TrustManager> |
getTrustManagers()
Returns a list of trust managers that will be used to validate communicating party credentials. |
java.lang.String |
getXmlCipher()
|
void |
init()
|
boolean |
isEncrypted(ProtectedStringType ps)
Returns true if protected string contains encrypted data that seems valid. |
void |
setEncryptionKeyAlias(java.lang.String encryptionKeyAlias)
|
void |
setKeyStorePassword(java.lang.String keyStorePassword)
|
void |
setKeyStorePath(java.lang.String keyStorePath)
|
void |
setPrismContext(PrismContext prismContext)
|
void |
setXmlCipher(java.lang.String xmlCipher)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AESProtector()
Method Detail |
---|
public void init()
SystemException
- if jceks keystore is not available on getKeyStorePath()
public java.lang.String getXmlCipher()
public void setXmlCipher(java.lang.String xmlCipher)
public PrismContext getPrismContext()
public void setPrismContext(PrismContext prismContext)
public void setEncryptionKeyAlias(java.lang.String encryptionKeyAlias)
encryptionKeyAlias
- Alias of the encryption key SecretKey
which is used
for encryption
java.lang.IllegalArgumentException
- if encryption key digest is null or empty stringpublic void setKeyStorePassword(java.lang.String keyStorePassword)
keyStorePassword
-
java.lang.IllegalArgumentException
- if keystore password is null stringpublic void setKeyStorePath(java.lang.String keyStorePath)
keyStorePath
-
java.lang.IllegalArgumentException
- if keystore path is null stringpublic java.lang.String decryptString(ProtectedStringType protectedString) throws EncryptionException
decryptString
in interface Protector
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE
installedpublic org.w3c.dom.Element decrypt(ProtectedStringType protectedString) throws EncryptionException
decrypt
in interface Protector
Element
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE
installedpublic ProtectedStringType encryptString(java.lang.String text) throws EncryptionException
encryptString
in interface Protector
ProtectedStringType
with encrypted string inside it. If
input argument is null or empty, method returns null.
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE
installedpublic ProtectedStringType encrypt(org.w3c.dom.Element plain) throws EncryptionException
encrypt
in interface Protector
ProtectedStringType
with encrypted element inside it. If
input argument is null, method returns null.
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE
installedpublic void encrypt(ProtectedStringType ps) throws EncryptionException
Protector
encrypt
in interface Protector
EncryptionException
public boolean isEncrypted(ProtectedStringType ps)
Protector
isEncrypted
in interface Protector
public java.util.List<javax.net.ssl.TrustManager> getTrustManagers()
Protector
getTrustManagers
in interface Protector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |