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?

有帮助吗?

解决方案

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

其他提示

There is no parameter for makecert to use SHA256 has a hashing algorithm for makecert.exe. You can only use -a md5 or -a sha1.

Note there are also issues with certificates using a SHA256/384/512 hash on Windows XP and Windows 2003 and earlier operating systems (see http://blogs.msdn.com/b/alejacma/archive/2009/01/23/sha-2-support-on-windows-xp.aspx) and this may be what you are seeing.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top