String pubKeyAlgo = publicKey.getAlgorithm();
if (pubKeyAlgo.equalsIgnoreCase("DSA")) {
DSAKeyValue dsaKeyValue = new DSAKeyValue(document, publicKey);
keyInfo.add(dsaKeyValue);
} else if (pubKeyAlgo.equalsIgnoreCase("RSA")) {
RSAKeyValue rsaKeyValue = new RSAKeyValue(document, publicKey);
keyInfo.add(rsaKeyValue);
} else {
throw new WSSecurityException(
WSSecurityException.FAILURE,
"unknownSignatureAlgorithm",