News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Mentalis on Mono/Linux certificate import exceptions  
by Angel Todorov [angel at atodorov dot com]
posted on 2004/11/10

Hello,
I used monodevelop to create a Mono project and buildfiles for mentalis , under linux (Red Hat Fedora core 2). I imported the compiled DLL in a test proj, which included, among other things, loading a certificate from a PFX (or CER) file. I got the following exceptions, with both the pfx format, and the .cer format, and i am wondering whether that's a problem with Mono's System.Security, or mentalis' implementation of the Certificate.cs class:

root@localhost Debug]# mono certtest.exe

Connecting and setting up network streams ...
Loading SSL certificate ...
Error loading certificate
in <0x00053> (wrapper managed-to-native) Org.Mentalis.Security.SspiProvider:CertOpenStore (intptr,int,int,int,string)
in <0x0006a> Org.Mentalis.Security.Certificates.CertificateStore:CreateFromCerFile (string)
in <0x0000e> Org.Mentalis.Security.Certificates.Certificate:CreateFromCerFile (string)

Maybe there is some Mono problem with the "managed-to-native wrapper", as stated in the exception, since the Exception's message returns "crypt32.dll", which is, as far as I know, unmanaged, and loaded by Pinvoke in Mono at least.


-------------------
Also, if i try loading a certificate from a Pfx file , i get a similar exception:

[root@localhost Debug]# mono certtest.exe

Connecting and setting up network streams ...
Loading SSL certificate ...
Error loading certificate
in <0x00053> (wrapper managed-to-native) Org.Mentalis.Security.SspiProvider:PFXIsPFXBlob (Org.Mentalis.Security.DataBlob&)
in <0x000a1> Org.Mentalis.Security.Certificates.CertificateStore:CreateFromPfxFile (byte[],string,bool,Org.Mentalis.Security.Certificates.KeysetLocation)
in <0x00018> Org.Mentalis.Security.Certificates.CertificateStore:CreateFromPfxFile (byte[],string,bool)
in <0x00013> Org.Mentalis.Security.Certificates.CertificateStore:CreateFromPfxFile (byte[],string)
in <0x0001a> Org.Mentalis.Security.Certificates.CertificateStore:CreateFromPfxFile (string,string)
in <0x0000f> Org.Mentalis.Security.Certificates.Certificate:CreateFromPfxFile (string,string)

-----------------------------
The environment is , as i said:

- the sources for the Mentalis SSL lib included in the distribution
- Linux Fedora Core 2, default kernel
- Mono 1.0.4 (stable branch)

Any help is greatly appreciated. Thanks.

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/11/19

The SecLib doesn't work on Linux. We use the Windows API a lot in the certificate management namespace, and these functions aren't present on a Linux machine.
The library is (officially) only supported on Microsoft's .NET framework. Other frameworks, such as the compact framework or mono, are not supported.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.