Search code examples
c#bouncycastlesignaturesha256makecert

How to self generate certificate SHA-256?


I use Bouncy Castle libraries in C# to sign with SHA-256, and I'd like to use them in a test of a self generated certificate instead of a smartcard reader.

Using the self certificate used before, I have a cryptographic exception:

specified algoritm not valid

If I use a SHA-1 signature with the same self certificate, it goes well. With the smartcard the same code run successfully.

What is the makecert parameter?


Solution

  • The 4.5 version of makecert supports other signing algorithms such as sha256, sha384, or sha512. See makecert 4.5 (-a)