none
Does SslStream Class Library support Sha256 Certificate in .Net framework? RRS feed

  • Question

  • Hello Techies,

    This is question about Sha2 certification validation. Currently we are using SHA1 Certifcate for SSL communication using SslStream class and HttpWebRequest class. We want to use SHA-2 certificate for SSL communication using SslStream class. We could see the current versions of .Net SslStream class and the HttpWebRequest class (public enum HashAlgorithmType) which has only MD5, None and Sha1 enumerations. We would like to use the same Class SslStream for Sha2 Certificate validation as well. Will any of the .Net framework allows the implementation of Sha2 certificate validation using SslStream Class or whether we need to do some additional task on this?

    We are using .net framework 2.0.

    Can anyone pls help us on this?

    Thanks in advance...

    Thursday, March 5, 2015 1:09 PM

Answers

  • Hello,

    >> Does SslStream Class Library support Sha256 Certificate in .Net framework?

    According to your description, I created a test X509 certificate with Sha256 algorithm by using markcert.exe with -a sha256:

    https://msdn.microsoft.com/en-us/library/bfsktky3(v=vs.110).aspx:

    -a  algorithm

     Specifies the signature algorithm. algorithm must be md5, sha1 (the default), sha256, sha384, or sha512.

    With the provided sample of the SslStream class, I changed my targets of client and server from 4.5 to 2.0, and I could make a successful communication between them, so I think the SslStream should work with SHA256 even in .NET 2.0, you could also have a try.

    Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 6, 2015 6:56 AM
    Moderator