XMLSignature.ALGO_ID_SIGNATURE_DSA);
doc.appendChild(sig.getElement());
sig.addDocument("");
//Add in the KeyInfo for the certificate that we used the private key of
X509Certificate cert =getCertificate();
sig.addKeyInfo(cert);
sig.addKeyInfo(cert.getPublicKey());
// Add these three lines
org.apache.xml.security.keys.KeyInfo ki = sig.getKeyInfo();
ki.itemX509Data(0).addSubjectName(cert.getSubjectDN().toString());
ki.itemX509Data(0).addIssuerSerial(cert.getIssuerDN().toString(),