SignedXml fails under .NET 2.0 Beta

From: Gabriel (gfogante_at_gmail.com)
Date: 03/05/05

  • Next message: Henrik Skak Pedersen: "StrongNameIdentityPermission and Web Services"
    Date: 5 Mar 2005 13:34:54 -0800
    
    

    Hi,

    I'm using the following code to check signed xml files:

    SignedXml signedXml = new SignedXml();
    // http://support.microsoft.com/default.aspx?scid=KB;EN-US;322371
    CspParameters cspParams = new CspParameters();
    cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
    RSACryptoServiceProvider rsaPublicKey = new
    RSACryptoServiceProvider(cspParams);
    rsaPublicKey.FromXmlString(xmlPublicKey);
    KeyInfo keyInfo = new KeyInfo();
    keyInfo.AddClause(new RSAKeyValue(rsaPublicKey));
    signedXml.KeyInfo = keyInfo;

    XmlNodeList nodeList = licenseData.GetElementsByTagName("Signature");
    signedXml.LoadXml((XmlElement)nodeList[0]);

    return signedXml.CheckSignature();

    This code works great under .NET 1.x and it FAILS under .NET 2.0 Beta.
    Do you know why?
    Thanks in advance.

    PS: xmlPublicKey contains the public key of course.


  • Next message: Henrik Skak Pedersen: "StrongNameIdentityPermission and Web Services"

    Relevant Pages

    • Re: Error Verifying Xml Digital Signature
      ... Found the fix after trawling through this newsgroup. ... CspParameters cspParam = new CspParameters; ... Apparently the default constructor for the RSA or DSA provider tries ... > generated and saved to file (using the SignedXml class). ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Compute XML Signature on external Xml document
      ... The Transform gives the expected XML output. ... XmlDocument domContext = new XmlDocument; ... SignedXml signedXml = new SignedXml; ... KeyInfo keyInfo = new KeyInfo; ...
      (microsoft.public.dotnet.security)
    • Problem with SignedXml and CheckSignature
      ... I've a problem with the SignedXml Class. ... when I check the signature, ... if I include the keyinfo in then xml-file which I sign. ... RSA rsa; ...
      (microsoft.public.dotnet.security)
    • RE: Problem with SignedXml and CheckSignature
      ... KeyInfo keyInfo; ... RSA rsa; ... Problem with SignedXml and CheckSignature ... > Reference reference; ...
      (microsoft.public.dotnet.security)
    • SignedXML
      ... I'm trying to create signed XML document with SignedXml class. ... SigningKey I'd like to use key pair obtained from user certificate ... Reference reference = new Reference; ... KeyInfo keyInfo = new KeyInfo; ...
      (microsoft.public.dotnet.xml)