none
VerifyData signed with "SHA256withRSA" algoritm always return false.

    Question

  • The SignedString is generated by "eid-web-applet-1.0-20121010.132118-1.jar" whit the algoritm "SHA256withRSA"

    This is the code I use, but I d0n't understand why it returns me always false :

    RSACryptoServiceProviderrsaCripto=(RSACryptoServiceProvider)certUserC.PublicKey.Key;

    byte[] signedBytes=Convert.FromBase64String(SignedString)     

    byte[] bytesToVerify=byteConverterUTF8.GetBytes(originalString);                

    RSACryptoServiceProviderp=newRSACryptoServiceProvider();

     p.FromXmlString(publicKey);

              

    SHA256mySHA256=SHA256Managed.Create();

      

    bool verified=p.VerifyData(bytesToVerify, mySHA256, signedBytes);

                   



    Edoardo Molinaro Product Specialist E-Mail: edo106@gmail.com






    Edoardo Molinaro Product Specialist E-Mail: edo106@gmail.com

    Wednesday, January 30, 2013 8:38 AM

All replies

  • Hi Edo106,

    I would like to redirect you to appropriate forum for better responses. 


    Bob Shen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    Thursday, January 31, 2013 10:26 AM
  • Hi Edoardo,

    It's hard to determine what the problem is unless you provide more information. 
    Can you provide the following?

    1. The base64 encoded certificate.

    2. The base64 encoded signature.

    3. The original string that was signed.

    Thanks


    Carlos Lopez - Microsoft Escalation Engineer

    Saturday, February 02, 2013 1:31 AM
  • Hello,

    Here data:

    1."MIIFwDCCA6igAwIBAgIIIOX3//7OPhMwDQYJKoZIhvcNAQELBQAwdjEeMBwGA1UEAwwVR0VPIEF1dGhlbnRpY2F0aW9uIENBMR4wHAYDVQQLDBVDaXZpbCBSZWdpc3RyeSBBZ2VuY3kxJzAlBgNVBAoMHk1pbmlzdHJ5IG9mIEp1c3RpY2Ugb2YgR2VvcmdpYTELMAkGA1UEBhMCR0UwHhcNMTEwODI5MjE0OTMxWhcNMTQwMjI3MjE0OTMxWjBSMRswGQYDVQQDDBJGaXJzdG5hbWUgTGFzdG5hbWUxFDASBgNVBAUTCzAwMDAwMDAwM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A+PoGORm4RpHsDFM4DXLrOLrKPyRWcP3t2s00BVCJwrNZTc/LwZESha2u/3H7I3HDJhnOzQfb0PiNi1ruvjN250nBMq0g9flHWosczzneV5ormpBptn85PDNiRUy/faZiU8qGdOmisYY4GoRAkihfjJEl/qO8cGv76yrrIbf3zEkDBx2AGDa+USq29rig58bxOfwzDWlDOTBKVv2uYZEul+X6kfQgaXpCIwD/z/cKpIB0KEYD238wgFOYiFGClsF6S01aYXRoQHaACQAHCwOgn27e/5IsfCVeak6+vTquQzWtC9FpjnH5QPZwZYNEfGX7w3kuSVQbGwKxrMUX4Yz6CA21+OhOK6kZ0ao0OaQKRdMXHC1RfttE0zgGn02rg+Awn386IE9SBssqrvZZxrdiDPfq5Zr5clqht61PVNTmuebZGZE9VQ9fdsuyS280K1Ct+6Eu7J5IwiN4fWM0rElinzVAqUzPMn5yhxHqqL4ZMkYyBVvpkKxoF434602DmWtS4HfKvNUZUM9hHHg/GTqdMo4EZkyF/x2P9dNW1YBrEwsok/rEpmGViquYr9+dLP"

    2."Ce3nAfKqekWzSbUaMcjQ1aFtRqZsvCUNsNPJZ1BeRVh9kus1nfg1ENGRbtxxlxC/VU4onpnxQY1PnqiRISRK6J1r66KnIPIsLGNC5RfuetaLMHRVAfIDBBrQy2V1XUOUqLweRVJM6Cpn++t1lnSuKBt2yi0rE4NEIKSX8MatBLErrQpXc8ow00NHZF2dhz6ksMhCcKi46uszbVngXiFVRUENlrfDgxs+zJ5VYI37x5e6hRU5VGYBbLBhuSII5pwmGX6ND+9uAYeSDoF9K6hJAl16jCaCAvJMkpd25zkhFUSysFjhGJ9Dmsozd+ucy81Pouq+NQplI5cZatJoyWYDmQ=="

    3."SOME CHALLENGE GENERATED BY YOUR SIT"

    thanks


    Edoardo Molinaro Product Specialist E-Mail: edo106@gmail.com

    Tuesday, May 28, 2013 3:57 PM