[Mono-bugs] [Bug 61796][Nor] Changed - exception getting x509 certificate info

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 23 Jul 2004 15:22:16 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by sebastien@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=61796

--- shadow/61796	2004-07-23 11:36:45.000000000 -0400
+++ shadow/61796.tmp.28942	2004-07-23 15:22:16.000000000 -0400
@@ -48,6 +48,20 @@
 CreateFromSignedFile support is incomplete (and documented as such).
 It's main use is to get a certificate from a signed file (like an
 Authenticode signed EXE file). For your sample the use of
 CreateFromCertFile should be used (and should work).
 
 However the code shouldn't throw a NullReferenceException in this case.
+
+------- Additional Comments From sebastien@ximian.com  2004-07-23 15:22 -------
+The certificate is in PEM (base64) format. This format isn't supported
+by the .NET framework, so it must be converted to DER before decoding.
+
+This is simple to do:
+a. remove both header and footer
+b. remove line endings
+c. get the binary using Convert.FromBase64String
+d. create a new X509Certificate with the buffer
+
+I'll keep this bug open because I'll fix the (most probably wrong)
+exception, NullReferenceException, in CreateFromSignedFile after
+vacations.