if (credential.getPublicKey().getAlgorithm().equalsIgnoreCase("DSA")) {
signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_DSA);
} else if (credential.getPublicKey().getAlgorithm().equalsIgnoreCase("RSA")) {
signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA);
} else {
throw new RuntimeException(new SignatureException("Unknown public key algorithm. Signature algorithm not set."));
}
//TODO: add more algos
signableXmlObject.setSignature(signature);