if (spec == null) {
throw new InvalidAlgorithmParameterException("Null parameter");
}
if (spec instanceof Parameters) {
try {
engineInit(((Parameters)spec).getKeyStore());
} catch (KeyStoreException e) {
throw new RuntimeException(e);
}
} else {
throw new InvalidAlgorithmParameterException("Invalid parameter");
}