EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Access to Mozilla/Firefox Certstore in SBB9

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#16592
Posted: 06/08/2011 09:39:54
by Wolfgang Denz (Standard support level)
Joined: 09/24/2008
Posts: 17

With the new Version 9 of SBB I wanted to access the Certstore of Mozilla/Firefox to import new certificates into it.
The following code gives an error 127 when calling the NSSCertStore.Open-method
"EEICertStorageError: PKCS#11 provider DLL could not be found oder loaded"
The path of the DLL "...Program Files\Mozilla Firefox\softokn3.dll" however is correct

Can anyone give me a hint what I'm doing wrong?

Thanks
Wolfgang

Code
SetCurrentDir('Path\to\Mozilla\Firefox);
Mainform.NSSCertStore.NSSParams.UseNSSMode := True;
Mainform.NSSCertStore.DLLName := 'softokn3.dll';
Mainform.NSSCertStore.NSSParams.ConfigDir := 'Path/to/Mozilla/Profile';
if FileExists('softokn3.dll') then
  begin
  Mainform.NSSCertStore.Open;
  session := Mainform.NSSCertStore.OpenSession  (Mainform.NSSCertstore.Module.SlotCount-1,false);
  session.Login(utUser,'Mozilla-Password');
  Mainform.NSSCertStore.Add(MainForm.CertStore.Certificates[0],True);
  session.Logout;
  Mainform.NSSCertStore.CloseSession(session.Handle);
  Mainform.NSSCertStore.Close;
  end;
#16593
Posted: 06/08/2011 10:07:00
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Does the same error occures if you open NSS storage using our demo that is located in \EldoS\SecureBlackbox\Samples\Delphi\PKIBlackbox\PKCS11\CertStorage folder?
#16607
Posted: 06/09/2011 05:56:50
by Wolfgang Denz (Standard support level)
Joined: 09/24/2008
Posts: 17

Yes an error occures also with the sample-project.
The sample gives an "Access violation at..." after I choose the softokn3.dll

Regards
Wolfgang
#16614
Posted: 06/09/2011 07:25:04
by Vsevolod Ievgiienko (EldoS Corp.)

Try to specify a full path to softokn3.dll driver.
#16619
Posted: 06/09/2011 08:43:54
by Vsevolod Ievgiienko (EldoS Corp.)

You can fix the demo by explicitly adding OpenDirForm.pas to the project. A fixed demo will be also included in the next SBB build that is expected on this weekend.
#16620
Posted: 06/09/2011 09:02:44
by Wolfgang Denz (Standard support level)
Joined: 09/24/2008
Posts: 17

OK, the tip with the missing form worked

Thanks
Wolfgang
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 1900 times

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




|

Back to top

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

Got it!