if (spec == null) {
throw new InvalidAlgorithmParameterException("Incorrect parameter");
}
if (spec instanceof Parameters) {
try {
engineInit(((Parameters)spec).getKeyStore(),
((Parameters)spec).getPassword());
} catch (Exception e) {
throw new InvalidAlgorithmParameterException(e.toString());
}
} else {
throw new InvalidAlgorithmParameterException("Invalid parameter");
}