Click here to Skip to main content
15,923,006 members
Home / Discussions / C#
   

C#

 
GeneralRe: Email verification not validation Pin
khosnur17-Sep-09 0:54
khosnur17-Sep-09 0:54 
AnswerRe: Email verification not validation Pin
Arun Jacob17-Sep-09 1:20
Arun Jacob17-Sep-09 1:20 
Questionhow to find websites that are using google ad-sense Pin
Anil Veeraghattapu 416-Sep-09 23:10
Anil Veeraghattapu 416-Sep-09 23:10 
AnswerRe: how to find websites that are using google ad-sense Pin
benjymous17-Sep-09 0:46
benjymous17-Sep-09 0:46 
GeneralRe: how to find websites that are using google ad-sense Pin
Anil Veeraghattapu 419-Sep-09 0:53
Anil Veeraghattapu 419-Sep-09 0:53 
GeneralRe: how to find websites that are using google ad-sense Pin
benjymous20-Sep-09 23:33
benjymous20-Sep-09 23:33 
Questionany way without cast [modified] Pin
mary_sa16-Sep-09 23:06
mary_sa16-Sep-09 23:06 
AnswerRe: no list my winservice at services Pin
Calla17-Sep-09 0:05
Calla17-Sep-09 0:05 
QuestionGeneric event triggering Pin
skbrann16-Sep-09 22:51
skbrann16-Sep-09 22:51 
AnswerRe: Generic event triggering Pin
N a v a n e e t h17-Sep-09 3:00
N a v a n e e t h17-Sep-09 3:00 
GeneralRe: Generic event triggering Pin
skbrann20-Sep-09 21:49
skbrann20-Sep-09 21:49 
QuestionDll info Pin
mikla52116-Sep-09 22:30
mikla52116-Sep-09 22:30 
AnswerRe: Dll info Pin
Luc Pattyn17-Sep-09 2:46
sitebuilderLuc Pattyn17-Sep-09 2:46 
QuestionValidate java SAML signature from C# Pin
adrya16-Sep-09 21:57
adrya16-Sep-09 21:57 
AnswerRe: Validate java SAML signature from C# Pin
Mirko198016-Sep-09 23:02
Mirko198016-Sep-09 23:02 
GeneralRe: Validate java SAML signature from C# Pin
adrya16-Sep-09 23:25
adrya16-Sep-09 23:25 
I know to parse SAML, i need to validate the signature.
I tried this:

public bool VerifySignature()
       {
           X509Certificate2 certificate = null;

           XmlDocument doc = new XmlDocument();
           XmlElement xmlAssertionElement = this.GetXml(doc);
           doc.AppendChild(xmlAssertionElement);

           // Create a new SignedXml object and pass it
           // the XML document class.
           SamlSignedXml signedXml = new SamlSignedXml(xmlAssertionElement);

           // Get signature
           XmlElement xmlSignature = this.Signature;
           if (xmlSignature == null)
           {
               return false;
           }

           // Load the signature node.
           signedXml.LoadXml(xmlSignature);

           // Get the certificate used to sign the assertion if information about this
           // certificate is available in the signature of the assertion.
           foreach (KeyInfoClause clause in signedXml.KeyInfo)
           {
               if (clause is KeyInfoX509Data)
               {
                   if (((KeyInfoX509Data)clause).Certificates.Count > 0)
                   {
                       certificate = (X509Certificate2)((KeyInfoX509Data)clause).Certificates[0];
                   }

               }
           }

           if (certificate == null)
           {
               return false;
           }

           return signedXml.CheckSignature(certificate, true);

       }


It valides the signature of a SAML signed in .Net but not of this Java one.
GeneralRe: Validate java SAML signature from C# Pin
adrya23-Sep-09 19:03
adrya23-Sep-09 19:03 
QuestionHow can I get the local machine's IP address in a Windows app ? Pin
Rahad Rahman16-Sep-09 21:23
professionalRahad Rahman16-Sep-09 21:23 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
stancrm16-Sep-09 21:26
stancrm16-Sep-09 21:26 
GeneralRe: How can I get the local machine's IP address in a Windows app ? Pin
Calla16-Sep-09 21:36
Calla16-Sep-09 21:36 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
Harvey Saayman16-Sep-09 22:03
Harvey Saayman16-Sep-09 22:03 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
Luc Pattyn17-Sep-09 2:49
sitebuilderLuc Pattyn17-Sep-09 2:49 
AnswerRe: How can I get the local machine's IP address in a Windows app ? Pin
carlecomm22-Sep-09 2:02
carlecomm22-Sep-09 2:02 
QuestionTCP Servers Pin
Harvey Saayman16-Sep-09 21:18
Harvey Saayman16-Sep-09 21:18 
AnswerRe: TCP Servers Pin
N a v a n e e t h16-Sep-09 22:13
N a v a n e e t h16-Sep-09 22:13 

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.