if ((paramAlgorithm != null) ||
(paramPassword != null) ||
(paramKeyObtentionIterations != null)) {
throw new EncryptionInitializationException(
"If \"" + ParameterNaming.ENCRYPTOR_NAME +
"\" is specified, none of \"" +
ParameterNaming.ALGORITHM + "\", \"" +
ParameterNaming.PASSWORD + "\" or \"" +
ParameterNaming.KEY_OBTENTION_ITERATIONS + "\" " +
"can be specified");
}
this.encryptorName = paramEncryptorName;
this.useEncryptorName = true;
} else if ((paramPassword != null)) {
this.password = paramPassword;
if (paramAlgorithm != null) {
this.algorithm = paramAlgorithm;
}
if (paramKeyObtentionIterations != null) {
try {
this.keyObtentionIterations =
new Integer(
Integer.parseInt(paramKeyObtentionIterations));
} catch (NumberFormatException e) {
throw new EncryptionInitializationException(
"Value specified for \"" +
ParameterNaming.KEY_OBTENTION_ITERATIONS +
"\" is not a valid integer");
}
}
} else {
throw new EncryptionInitializationException(
"If \"" + ParameterNaming.ENCRYPTOR_NAME +
"\" is not specified, then \"" +
ParameterNaming.PASSWORD + "\" (and optionally \"" +
ParameterNaming.ALGORITHM + "\" and \"" +
ParameterNaming.KEY_OBTENTION_ITERATIONS + "\") " +
"must be specified");
}
if (paramDecimalScale != null) {
try {
this.decimalScale =
new Integer(Integer.parseInt(paramDecimalScale));
} catch (NumberFormatException e) {
throw new EncryptionInitializationException(
"Value specified for \"" +
ParameterNaming.DECIMAL_SCALE +
"\" is not a valid integer");
}
} else {
throw new EncryptionInitializationException(
ParameterNaming.DECIMAL_SCALE +
" must be specified");
}