none
OID for SHA256 is unknown on Windows XP RRS feed

  • Question

  • I made a program to verify signatures by using RSAPKCS1SignatureDeformatter as follows.

    deformatter = new RSAPKCS1SignatureDeformatter(rsa);
    deformatter.SetHashAlgorithm("SHA256");

    When I ran the program on Windows XP SP3 with dotnetfw3.5, the following errorr occured.

    CryptographicException - Object identifier (OID) is unknown

    - I didn't have the problem on Windows Vista and Windows 7.

    - When I changed hash algorithm from SHA256 to SHA1, I didn't have the problem even on Windows XP.

    Are there any ways to use SHA256withRSA for verification algorithm on Windows XP?

    • Moved by Amanda Zhu Monday, January 28, 2013 4:48 AM
    Friday, January 25, 2013 7:25 PM

Answers

  • Hi Hirotana,

    Welcome to the MSDN Forum.

    How about the fix in this thread:

    To fix the issue,

    1. Download  Security.Cryptography.dll from http://clrsecurity.codeplex.com/  - I built from source
    2. Create a console application that references Security.Cryptography.dll
    3. Add the code below and execute the console application.
    using Security.Cryptography;

    class Program
    {
        static void Main(string[] args)
        {
            Oid2.RegisterSha2OidInformationForRsa();
        }
    }

    Best regards,


    Mike Feng
    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.

    Monday, January 28, 2013 11:35 AM
    Moderator

All replies

  • Hello,

    We have a forum Common Language Runtime Internals and Architecture for this issue. In order to provide better support, I will move this thread.

    Best regards,


    Amanda Zhu [MSFT]
    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.

    Monday, January 28, 2013 4:48 AM
  • Hi Hirotana,

    Welcome to the MSDN Forum.

    How about the fix in this thread:

    To fix the issue,

    1. Download  Security.Cryptography.dll from http://clrsecurity.codeplex.com/  - I built from source
    2. Create a console application that references Security.Cryptography.dll
    3. Add the code below and execute the console application.
    using Security.Cryptography;

    class Program
    {
        static void Main(string[] args)
        {
            Oid2.RegisterSha2OidInformationForRsa();
        }
    }

    Best regards,


    Mike Feng
    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.

    Monday, January 28, 2013 11:35 AM
    Moderator