Could not load module. Module name:beidpkcs11.dll

464 views
Skip to first unread message

Nikita Goncharuk

unread,
Feb 5, 2018, 2:39:56 AM2/5/18
to eID Middleware Dev
Hi, i want to create a MacOS app on C# with Xamarin.Mac. 
At first i tried to test your examples on Windows and i get an error "Could not load module. Module name:beidpkcs11.dll".
This error occurs in the GetData () method:

public string GetData(String label)
       
{
           
String value = "";
           
if (m == null)
           
{
                m
= Module.GetInstance(mFileName); // error
           
}


           
// pkcs11 module init
           
//m.Initialize();
           
try
           
{
               
.....
           
}
           
return value;
       
}


At first I build C# pkcs11wrappers project. 
I also searched for the beidpkcs11.dll file, but did not find it. Can this be due to the fact that I have not installed eID software app

Also i have a second question:
Can I use your C # library to create a Mac OS X application? Does it support .Net Standart?
What would I do with this application I just need to include 2 library data Net.Pkcs.dll and beidpkcs11.dll?

Frederik Vernelen

unread,
Feb 5, 2018, 2:55:44 AM2/5/18
to Nikita Goncharuk, eID Middleware Dev
Hello Nikita,

I have no experience with Xamarin, I've taken a quick look at their site, and see they mention Android, ios en Windows, didn't see macOS.
I think its best to ask their support: https://www.xamarin.com/support

In regards of your question about  beidpkcs11.dll: this windows library is part of our eid software installation, so it is exactly what you thought. (you need to install the eID software for windows)

Wkr,
 Frederik

--
You received this message because you are subscribed to the Google Groups "eID Middleware Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eid-middleware-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nikita Goncharuk

unread,
Feb 5, 2018, 4:45:42 AM2/5/18
to eID Middleware Dev
On xamarin you can write MacOS, see the link: 
https://developer.xamarin.com/guides/mac/getting_started/hello,_mac/

But I just need to know if I can use your library, I've heard something about .NetStandart. 
If your library does not use native Windows code or supports  .NetStandart. I think it will work.

Frederik Vernelen

unread,
Feb 5, 2018, 4:57:02 AM2/5/18
to Nikita Goncharuk, eID Middleware Dev
Our eID Viewer UI uses .NET, 
but our pkcs11 library uses Standard Windows Libraries, no Common Language Runtime Support.




Nikita Goncharuk

unread,
Feb 5, 2018, 8:35:49 AM2/5/18
to eID Middleware Dev
Hi again

If i created a macOS app, which list of Object-C library i need to add in my project. List of libraries Such a list as in the picture?

Best regards
Nikita
Набросок.png

Frederik Vernelen

unread,
Feb 5, 2018, 8:54:21 AM2/5/18
to Nikita Goncharuk, eID Middleware Dev
Hello,

If working with Xcode is an option, you might want to check out our eID Viewer for macOS, which is written in objective C, and which uses a eID Viewer backend that loads our pkcs11 C-library.

You can find this viewer here:
https://github.com/Fedict/eid-mw/tree/eid-mw-v4.3 /plugins_tools/eid-viewer/OSX/ eID Viewer

Wkr,
 Frederik


--

Nikita Goncharuk

unread,
Feb 5, 2018, 9:36:55 AM2/5/18
to eID Middleware Dev
I'm still trying to do this via Visual Studio, I found a way to port the native objective - C library to Xamarin. I need only a library that will communicate with libbeidpkcs11.dylib. 
The documentation contains a file with the extension .a, but i cannot find the reference.

Nikita Goncharuk

unread,
Feb 5, 2018, 9:42:52 AM2/5/18
to eID Middleware Dev
I also tried to enable NetPkcs11.dll, and I succeeded, but it can not find beidpkcs11.dll, because the library name or search method is different. However, if I could use NetPkcs11.dll, I would be glad. 

Wouter Verhelst

unread,
Feb 6, 2018, 4:55:02 AM2/6/18
to eid-middl...@googlegroups.com

I'm assuming that NetPkcs11.dll wants to use a native PKCS#11 library. If that is the case, you can use /usr/local/lib/beidpkcs11.module/Contents/MacOS/libbeidpkcs11.dylib

Regards,


On 05/02/2018 15:42, Nikita Goncharuk wrote:
I also tried to enable NetPkcs11.dll, and I succeeded, but it can not find beidpkcs11.dll, because the library name or search method is different. However, if I could use NetPkcs11.dll, I would be glad. 
--
You received this message because you are subscribed to the Google Groups "eID Middleware Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eid-middleware-...@googlegroups.com.

Wouter Verhelst

unread,
Feb 6, 2018, 4:57:52 AM2/6/18
to eid-middl...@googlegroups.com

You can also just load the Framework that is shipped with the eID Viewer. That way you do not need to compile it yourself; however, your application will then only work if the eID Viewer is installed on the user's system. Alternatively, you could copy the Framework from the eID Viewer and ship it as part of your application bundle.

Regards,
To unsubscribe from this group and stop receiving emails from it, send an email to eid-middleware-...@googlegroups.com.

Nikita Goncharuk

unread,
Feb 6, 2018, 5:12:00 AM2/6/18
to eID Middleware Dev
I cannot load the libbeidpkcs11.dylib for two reasons:
1. The library file extension is different
2. The method of searching this library differs, I think that on Windows it looks something like this C: / System32

вторник, 6 февраля 2018 г., 12:55:02 UTC+3 пользователь Wouter Verhelst написал:

I'm assuming that NetPkcs11.dll wants to use a native PKCS#11 library. If that is the case, you can use /usr/local/lib/beidpkcs11.module/Contents/MacOS/libbeidpkcs11.dylib

Regards,


On 05/02/2018 15:42, Nikita Goncharuk wrote:
I also tried to enable NetPkcs11.dll, and I succeeded, but it can not find beidpkcs11.dll, because the library name or search method is different. However, if I could use NetPkcs11.dll, I would be glad. 
--
You received this message because you are subscribed to the Google Groups "eID Middleware Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eid-middleware-dev+unsub...@googlegroups.com.

Wouter Verhelst

unread,
Feb 6, 2018, 5:13:56 AM2/6/18
to eid-middl...@googlegroups.com

Yes, obviously if you're trying to load a .dll that is not a common runtime one on MacOS that won't work. That's why I said "native PKCS#11 library".

If you can't load a native PKCS#11 library, then you can't write it in C#, and you'll have to write it in Objective-C or Swift or something of the sorts.

To unsubscribe from this group and stop receiving emails from it, send an email to eid-middleware-...@googlegroups.com.

Nikita Goncharuk

unread,
Feb 7, 2018, 4:03:30 AM2/7/18
to eID Middleware Dev
Use Pkcs11Interloop nuget package. It support Xamarin, Linux, Windows and etc. on C#.

вторник, 6 февраля 2018 г., 13:13:56 UTC+3 пользователь Wouter Verhelst написал:

Nikita Goncharuk

unread,
Feb 7, 2018, 4:05:50 AM2/7/18
to eID Middleware Dev
https://github.com/Pkcs11Interop/Pkcs11Interop

понедельник, 5 февраля 2018 г., 10:39:56 UTC+3 пользователь Nikita Goncharuk написал:
Reply all
Reply to author
Forward
0 new messages