[Mono-bugs] [Bug 646491] Constructor X509Certificate2(byte[]) throws an exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Oct 14 13:51:43 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=646491

https://bugzilla.novell.com/show_bug.cgi?id=646491#c4


Sebastien Pouliot <spouliot at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 CC|                            |spouliot at novell.com
       InfoProvider|                            |djechelon at fastwebnet.it

--- Comment #4 from Sebastien Pouliot <spouliot at novell.com> 2010-10-14 17:51:42 UTC ---
That's how your sample code goes on MS FX / WinXP.

C:\temp\Certificate\bin\Debug>Certificate.exe
Reading sample.p12
System.Security.Cryptography.CryptographicException: The specified network
passw
ord is not correct.

   at
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicExcep
tion(Int32 hr)
   at
System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(
String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet,
SafeCer
tContextHandle& pCertCtx)
   at
System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertific
ateFromFile(String fileName, Object password, X509KeyStorageFlags
keyStorageFlag
s)
   at
System.Security.Cryptography.X509Certificates.X509Certificate..ctor(String
 fileName)
   at
System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Strin
g fileName)
   at Certificate.Program.Main(String[] args)

Which is likely a "empty password" (which is not clearly defined in pkcs12)
issue. Always supply a password when using PKCS12, which solve the issue where
some implementation use null or "" for "no password". 

I'm pretty sure a working sample on windows will also work on mono - but the
reverse is not always true, e.g. for backward compatibility, since mono support
for PKCS12 predate the FX (2.0) support.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list