} catch (InvalidKeyException ex) {
throw new XMLSignatureException(ex);
}
} else if ( signatureAlgo.equals(SignatureMethod.HMAC_SHA1)) {
SignatureMethodParameterSpec params = (SignatureMethodParameterSpec)sm.getParameterSpec();
int outputLength = -1;
if (params != null) {
if (!(params instanceof HMACParameterSpec)) {
throw new XMLSignatureException
("SignatureMethodParameterSpec must be of type HMACParameterSpec");