Problem solved. It was a namespace issue.
Here is what I did -
1) after signing the DOM, I serialized the msg using the Canonicalizer
and dumped it...
sig.sign(privKey);
byte[] bytes1 = Canonicalizer.getInstance(
Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS).canonicalizeSubtree(doc);
Strin
XPathExpression expr = null;
>>
>> expr = xpath
>>
>> .compile("//saml:Assertion/ds:Signature");
>>
>> Element sigElement = null;
>>
>> sigElement = (Elemen
:35 AM
Subject: Re: Signature verification issue
> transformer.setOutputProperty(OutputKeys.INDENT, "no");
Hmmm, I had indent set to no
So I tried removing this:
> transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount";,
"4");
PROTECTED]
08/05/2008 11:19 AM
Please respond to
security-dev@xml.apache.org
To
security-dev@xml.apache.org
cc
Subject
Re: Signature verification issue
Ok what are you doing is adding spaces as you are indenting the
result, as space is a relevant content you are destroying the
signature in the p
signature = new XMLSignature(sigElement, "");
>
> boolean isSuccess =
> signature.checkSignatureValue((Key) cred
> .get("publicKey"));
> LogManager.debug("First
t;First verification = " +
isSuccess);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
Is anything wrong with how I am doing that that would impact the results?
"Raul Benito" <[EMAIL PROTEC
You have to serialize the signature and deserialize it sadly the
internal structures doesn't manage signing and verifying and the same
time.
On Mon, Aug 4, 2008 at 1:42 PM, <[EMAIL PROTECTED]> wrote:
>
> I am trying to create, then verify a signature, without much success. I
> assume something I
I am trying to create, then verify a signature, without much success. I
assume something I am doing is corrupting the XML, so I chnaged the code
to call checkSignatureValue() immediately after calling sign():
Document doc = assertion.getOwnerDocument();
doc.norma