I am using xml signatures to validate saml request :
The initial saml request before signing :
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID
="abc" Version="2.0" IssueInstant="2012-04-14T8:55:05:31" ProtocolBinding="urn:o
asis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="http://l
ocalhost:8080/consumer.jsp"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0
:assertion">http://localhost:8080/saml/SProvider.jsp</saml:Issuer></samlp:AuthnR
equest>
After signing the xml document and then converting it into string(using transformer) I am getting the following:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><samlp:AuthnReques
t xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" AssertionConsumerServiceURL
="http://localhost:8080/consumer.jsp" ID="abc" IssueInstant="2012-04-14T8:55:05:
31" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.
0"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://localh
ost:8080/saml/SProvider.jsp</saml:Issuer><Signature xmlns="http://www.w3.org/200
0/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/
TR/2001/REC-xml-c14n-20010315#WithComments"/><SignatureMethod Algorithm="http://
www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI=""><Transforms><Transform A
lgorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><
DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/><DigestValue>J
QV+Gff3C0PDb5zbaB62ItqWaJ/yIFgOVfANUehlJpQ=</DigestValue></Reference></SignedInf
o><SignatureValue>PJCFgkGUlQiOVn6g0hTgbbHkqOGAKB5sA8QjcdKrR5R9zuyn9ymfFZMo1jqpxU
//#here 3UOCz1BcxsWt6+
CSFSAS0SaQstuN8ns/5ltIYu3LFUrpIT4eRHxbYEjf+CFj0c08lFB+BLK3Tx3vEi7nQF+X1rUvZX
XZEUmaAMLqNdhRSqurY=</SignatureValue></Signature></samlp:AuthnRequest>
As you can see the first attribute in the initial string is ID But after signing the first attrubute is AssertionConsumerServiceURL. Why is getting jumbled? Moreover in the signed document see #here
(third line from last), there is a line break. Why is there a line break.I don't think encrypted values contain line breaks. I don't understand what is happening. Please help.