public EncryptionMethodParams engineInit(
Document doc, EncryptionMethodParams params)
throws org.apache.xml.security.exceptions.XMLSecurityException {
if (params != null) {
throw new XMLSecurityException(
"encryption.algorithmCannotEatInitParams");
}
try {
this._cipher = Cipher.getInstance(this.getImplementedAlgorithmJCE(),
this.getRequiredProviderName());
MessageDigestAlgorithm mda = MessageDigestAlgorithm.getInstance(doc,
Constants.ALGO_ID_DIGEST_SHA1);
this._sha1digest = mda.getAlgorithm();
} catch (NoSuchAlgorithmException ex) {
throw new XMLSecurityException("empty", ex);
} catch (NoSuchProviderException ex) {
throw new XMLSecurityException("empty", ex);
} catch (NoSuchPaddingException ex) {
throw new XMLSecurityException("empty", ex);
}
return params;
}