Convert a String into a Securable object
Class name must be fully qualified, eg. oracle.toplink.essentials.internal.security.JCEEncryptor
Default is the JCEEncryptor
boolean initPassThroughEncryptor = false;
if (m_securableClassName == null) {
// Since we are defaulting, hence, assuming they can initialize the JCE
// libraries, if the init fails, this flag tells us to assume no encryption.
// However, if the JCE init does work, the JCEEncryptor will need to
// determine that a password was not encrypted by it, therefore, assume
// clear text. See JCEEncryptor.
initPassThroughEncryptor = true;
m_securableClassName = JCE_ENCRYPTION_CLASS_NAME;
}
try {
ConversionManager cm = ConversionManager.getDefaultManager();
Class securableClass = (Class)cm.convertObject(m_securableClassName, Class.class);
if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
try {
m_securableObject = (Securable)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(securableClass));
} catch (PrivilegedActionException exception) {
throw exception.getException();
}
} else {
m_securableObject = (Securable)PrivilegedAccessHelper.newInstanceFromClass(securableClass);
}
} catch (Throwable e) {
if (initPassThroughEncryptor) {// default failed, so perform no encryption.
m_securableObject = new PassThroughEncryptor();
} else {
throw ValidationException.invalidEncryptionClass(m_securableClassName, e);
}
}