2
當我做X509Certificate2 x509 = new X509Certificate2(certificateFile);
證書需要在什麼格式?X509證書格式
我有一個私鑰:
-----BEGIN RSA PRIVATE KEY-----
......
-----END RSA PRIVATE KEY-----
和證書:
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
..............
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=IL, ST=SS, L=...., O=....., OU=....., CN=...../emailAddress=.....
Validity
Not Before: Mar 19 14:45:09 2013 GMT
Not After : Mar 19 14:45:09 2014 GMT
Subject: C=IL, ST=SS, L=...., O=....., OU=....., CN=...../emailAddress=.....
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
...................
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
.........
X509v3 Authority Key Identifier:
keyid:..........
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
.....
但我既不能使用上面的C#代碼加載。我錯過了什麼?
你是什麼意思「無法加載」?你是否遇到異常?是否有堆棧跟蹤? – 2013-03-20 17:30:44
「無法找到請求的對象」 – user2191209 2013-03-20 17:45:59
根據[文檔](http://msdn.microsoft.com/en-us/library/ms148415.aspx)支持DER或Base64格式。 – 2013-03-20 17:52:04