Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
QuestionReference as a 'pointer' to a value type Pin
kildareflare30-Jul-07 7:37
kildareflare30-Jul-07 7:37 
AnswerRe: Reference as a 'pointer' to a value type Pin
Bert delaVega30-Jul-07 8:02
Bert delaVega30-Jul-07 8:02 
AnswerRe: Reference as a 'pointer' to a value type Pin
Luc Pattyn30-Jul-07 8:15
sitebuilderLuc Pattyn30-Jul-07 8:15 
GeneralRe: Reference as a 'pointer' to a value type [modified] Pin
kildareflare30-Jul-07 9:09
kildareflare30-Jul-07 9:09 
GeneralRe: Reference as a 'pointer' to a value type Pin
Luc Pattyn30-Jul-07 9:12
sitebuilderLuc Pattyn30-Jul-07 9:12 
GeneralRe: Reference as a 'pointer' to a value type Pin
kildareflare30-Jul-07 9:17
kildareflare30-Jul-07 9:17 
GeneralRe: Reference as a 'pointer' to a value type Pin
Cfer8330-Jul-07 9:37
Cfer8330-Jul-07 9:37 
QuestionCheckSignature of SignedXml returns false Pin
amit_k_gupta30-Jul-07 7:37
amit_k_gupta30-Jul-07 7:37 
Dear Friends,
I have to validate digital signature inside an XML which we receive from our client. Client has given us their cetificate also which contains their public key. I am using following lines of code to verify the signature but I am getting false everytime. Moreover, .Net framework does not tell what went wrong behind giving this false output value. I am using .Net framework 1.1/C#.

<br />
XmlDocument xmlDoc = new XmlDocument();<br />
xmlDoc.PreserveWhitespace = true;<br />
xmlDoc.LoadXml(SamlXML);<br />
bool validSaml = false;<br />
<br />
X509Certificate cert = X509Certificate.CreateFromCertFile(certificateFileName); <br />
XmlNamespaceManager mgr = new XmlNamespaceManager(xmlDoc.NameTable);<br />
mgr.AddNamespace("saml",this.samlAssertionNameSpaceURI);<br />
mgr.AddNamespace("ds",this.digitalSignatureNameSpaceURI);<br />
XmlNode nodeSignature = rootNode.SelectSingleNode("//saml:Assertion//ds:Signature",mgr);<br />
if(nodeSignature == null)<br />
{<br />
	this.errorNumber = Const.SAML_ASSERTION_SIGNATURE_INVALID_NOT_DEFINED;<br />
	this.errorMessage = "ds:Signature node is missing";<br />
	return validSaml;<br />
}			<br />
<br />
SignedXml verifier = new SignedXml(xmlDoc);<br />
verifier.LoadXml((XmlElement)nodeSignature);<br />
<br />
KeyInfo key = new KeyInfo();<br />
key.AddClause(new KeyInfoX509Data(cert));<br />
verifier.KeyInfo = key;<br />
<br />
if(verifier.CheckSignature())<br />
      validSaml = true;<br />
else<br />
     validSaml = false;<br />


I am getting false everytime when I call CheckSignature() method. Can someone please help me. I would appreciate any type of help in this matter.

Thanks and Regards,

Amit
QuestionXML serialization - Class and Property [modified] Pin
User 665830-Jul-07 7:25
User 665830-Jul-07 7:25 
AnswerRe: XML serialization - Class and Property Pin
Martin#30-Jul-07 8:02
Martin#30-Jul-07 8:02 
GeneralRe: XML serialization - Class and Property Pin
User 665830-Jul-07 8:44
User 665830-Jul-07 8:44 
AnswerRe: XML serialization - Class and Property Pin
BoneSoft30-Jul-07 9:20
BoneSoft30-Jul-07 9:20 
QuestionForm Designer and Dispose() Pin
PhilDanger30-Jul-07 7:14
PhilDanger30-Jul-07 7:14 
QuestionHow Do I Define String Length? Pin
JamesBarnes30-Jul-07 7:05
JamesBarnes30-Jul-07 7:05 
AnswerRe: How Do I Define String Length? Pin
Judah Gabriel Himango30-Jul-07 7:09
sponsorJudah Gabriel Himango30-Jul-07 7:09 
GeneralRe: How Do I Define String Length? Pin
JamesBarnes30-Jul-07 7:18
JamesBarnes30-Jul-07 7:18 
GeneralRe: How Do I Define String Length? Pin
PIEBALDconsult30-Jul-07 10:49
mvePIEBALDconsult30-Jul-07 10:49 
Questionlayouting a hidden control Pin
burn_hh30-Jul-07 6:49
burn_hh30-Jul-07 6:49 
QuestionSQL Database Pin
ankit_mait30-Jul-07 6:40
ankit_mait30-Jul-07 6:40 
AnswerRe: SQL Database Pin
Paul Conrad30-Jul-07 6:43
professionalPaul Conrad30-Jul-07 6:43 
AnswerRe: SQL Database Pin
Cfer8330-Jul-07 9:44
Cfer8330-Jul-07 9:44 
GeneralRe: SQL Database Pin
ankit_mait30-Jul-07 20:07
ankit_mait30-Jul-07 20:07 
QuestionData-bound DataGrid: Custom sorting? Pin
Stanimir_Stoyanov30-Jul-07 6:33
Stanimir_Stoyanov30-Jul-07 6:33 
QuestionMy variables content appear in hexadecimal Pin
gapfulgence30-Jul-07 5:47
gapfulgence30-Jul-07 5:47 
AnswerRe: My variables content appear in hexadecimal Pin
Bert delaVega30-Jul-07 5:54
Bert delaVega30-Jul-07 5:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.