EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Exception loading cert into store on PPC

Posted: 06/05/2006 08:52:42
by Aaron Cohen (Basic support level)
Joined: 06/05/2006
Posts: 6


I am evaluating SecureBlackbox.PKI for use in an automated test system running on PocketPC devices using the .Net Compact Framework. When I try to add or remove a certificate from a specified cert store, I get the following exception:
"Can't find an Entry Point 'CertOpenSystemStoreW' in a PInvoke DLL 'crypt32.dll'."

Here is the code:
TElWinCertStorage certStore = setstore(store);
TElX509Certificate cert = new TElX509Certificate();
using (System.IO.FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open))
cert.LoadFromStream(fs, 0);
certStore.Add(cert, store, copyPrivateKey, false, false);
return "Cert Loaded";

Any help would be greatly appreciated.

Posted: 06/05/2006 13:58:17
by Ken Ivanov (Team)

Thank you for reporting the problem.

Would you be so kind to specify the call stack that takes place when the exception is thrown (with 'show non-user code' checkbox enabled). Please also check that the 'store' variable contains a valid system store name.
Posted: 06/06/2006 09:40:03
by Aaron Cohen (Basic support level)
Joined: 06/05/2006
Posts: 6

Thanks for the reply.

The value of the store variale at the time of the exception is "Root" which should be valid. I tried "Personal" as well with the same effect.

As for the call stack, I don't see a 'show non-user code' checkbox when I right-click on the call stack in VS 2005, am I missing something? There was a checkbox for 'Show External Code', so I checked it. Here is the call stack immediately following the exception:
"> CeUtils.dll!CeUtils.Certificate.loadCert(string store = "Root", string fileName = "\\My Documents\\odcserver-root.cer", bool copyPrivateKey = false) Line 56 C#
CertsSample.exe!CertsSample.Form1.button2_Click(object sender = {Text = "Load"}, System.EventArgs e = {System.EventArgs}) Line 28 + 0x22 bytes C#
System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e = {System.EventArgs}) + 0x15 bytes
System.Windows.Forms.dll!System.Windows.Forms.Button.OnClick(System.EventArgs e = {System.EventArgs}) + 0x32 bytes
System.Windows.Forms.dll!System.Windows.Forms.ButtonBase.WnProc(Microsoft.AGL.Forms.WM wm = WM_BUTTON_NOTIFYCLICKED, int wParam = 0, int lParam = 0) + 0x17 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control._InternalWnProc(Microsoft.AGL.Forms.WM wm = WM_BUTTON_NOTIFYCLICKED, int wParam = 0, int lParam = 0) + 0x9 bytes
System.Windows.Forms.dll!Microsoft.AGL.Forms.EVL.EnterMainLoop(System.IntPtr hwnMain = 1114121)
System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form fm = {CertsSample.Form1}) + 0x1a bytes
CertsSample.exe!CertsSample.Program.Main() Line 15 + 0xa bytes C#"

Here is the stack trace generated with the exception if that helps:
"at SBWinCertStorage.TElWinCertStorage.Add()
at CeUtils.Certificate.loadCert()
at CertsSample.Form1.button2_Click()
at System.Windows.Forms.Control.OnClick()
at System.Windows.Forms.Button.OnClick()
at System.Windows.Forms.ButtonBase.WnProc()
at System.Windows.Forms.Control._InternalWnProc()
at Microsoft.AGL.Forms.EVL.EnterMainLoop()
at System.Windows.Forms.Application.Run()
at CertsSample.Program.Main()"

Please let me know if there's anything else I can do on my end to try to hunt this down. Thanks again, Aaron.
Posted: 06/06/2006 09:57:34
by Ken Ivanov (Team)

Thank you very much for the call stacks.

There was a checkbox for 'Show External Code', so I checked it.

Yes, this checkbox is called so in VS2005, so you did everything right.

It seems that .NET CF fails to find a CryptoAPI function for some reason. We will perform a deeper investigation of the problem and provide you an answer as soon as possible.
Posted: 06/13/2006 10:21:08
by Ken Ivanov (Team)

The problem is caused by a missing CryptoAPI CertOpenSystemStore() function on Windows CE (and MSDN says that this function is supported by this platform). We are implementing a workaround at the moment, the build update that fixes the issue will be published as soon as possible.
Posted: 07/24/2006 13:40:56
by Aaron Cohen (Basic support level)
Joined: 06/05/2006
Posts: 6

Any update on this?
Posted: 07/24/2006 14:55:36
by Eugene Mayevski (Team)

Please check build 94 on the site. If the issue is still present, then one would need to wait till SecureBlackbox 5.

Sincerely yours
Eugene Mayevski



Topic viewed 6016 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!