Constructor and Description |
---|
AESProtector() |
Modifier and Type | Method and Description |
---|---|
Element |
decrypt(ProtectedStringType protectedString) |
String |
decryptString(ProtectedStringType protectedString) |
ProtectedStringType |
encrypt(Element plain) |
void |
encrypt(ProtectedStringType ps)
Encrypts the ProtectedStringType "in place".
|
ProtectedStringType |
encryptString(String text) |
KeyStore |
getKeyStore() |
String |
getKeyStorePath() |
com.evolveum.midpoint.prism.PrismContext |
getPrismContext() |
String |
getSecretKeyDigest(SecretKey key) |
List<TrustManager> |
getTrustManagers()
Returns a list of trust managers that will be used to validate communicating party credentials.
|
String |
getXmlCipher() |
void |
init() |
boolean |
isEncrypted(ProtectedStringType ps)
Returns true if protected string contains encrypted data that seems valid.
|
void |
setEncryptionKeyAlias(String encryptionKeyAlias) |
void |
setKeyStorePassword(String keyStorePassword) |
void |
setKeyStorePath(String keyStorePath) |
void |
setPrismContext(com.evolveum.midpoint.prism.PrismContext prismContext) |
void |
setXmlCipher(String xmlCipher) |
public void init()
SystemException
- if jceks keystore is not available on getKeyStorePath()
public String getXmlCipher()
public void setXmlCipher(String xmlCipher)
public com.evolveum.midpoint.prism.PrismContext getPrismContext()
public void setPrismContext(com.evolveum.midpoint.prism.PrismContext prismContext)
public void setEncryptionKeyAlias(String encryptionKeyAlias)
encryptionKeyAlias
- Alias of the encryption key SecretKey
which is used
for encryptionIllegalArgumentException
- if encryption key digest is null or empty stringpublic void setKeyStorePassword(String keyStorePassword)
keyStorePassword
- IllegalArgumentException
- if keystore password is null stringpublic void setKeyStorePath(String keyStorePath)
keyStorePath
- IllegalArgumentException
- if keystore path is null stringpublic String getKeyStorePath()
public String decryptString(ProtectedStringType protectedString) throws EncryptionException
decryptString
in interface Protector
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE
installedpublic 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(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(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 String getSecretKeyDigest(SecretKey key) throws EncryptionException
EncryptionException
public boolean isEncrypted(ProtectedStringType ps)
Protector
isEncrypted
in interface Protector
public List<TrustManager> getTrustManagers()
Protector
getTrustManagers
in interface Protector
public KeyStore getKeyStore()
getKeyStore
in interface Protector
Copyright © 2014 Evolveum. All rights reserved.