Comments (5)
I guess you've hit one of a few limitations of the current pkcs11interop implementation (please see section "Supported features" on www.pkcs11interop.net for more info) specifically that unmanaged libraries that export only C_GetFunctionList() function are supported only on MS Windows platform. And unfortunately opensc-pkcs11.so is one of those libraries as you can see in its source code: https://github.com/OpenSC/OpenSC/blob/master/src/pkcs11/opensc-pkcs11.exports
This limitation exists because of the marshaling problem (probably bug) in Mono. I am planning to create test case and bug report for Mono next week, but it can take long time till it gets fixed there. So meanwhile you can try to use something like "proxy PKCS#11 library" that exports all PKCS#11 functions directly and put it in front of the opensc-pkcs11.so. Please take a look at my other project pkcs11-logger that implements such library: https://github.com/jariq/pkcs11-logger
You should be able to easily create following setup which should work even on linux:
Your application <---> pkcs11interop.dll <---> pkcs11-logger.so <---> opensc-pkcs11.so
from pkcs11interop.
Thanks for feedback, I will try. But another question how to you pkcs11-logger know where opensc-pkcs11 save ?
from pkcs11interop.
By default logger tries to load PKCS#11 library provided by OpenSC project which is "opensc-pkcs11.dll" on Windows or "opensc-pkcs11.so" on Linux. But you can use PKCS11_LOGGER_ORIG_LIB environment variable to specify another library.
This is the "classic" way to use Pkcs11interop:
using (Pkcs11 pkcs11 = new Pkcs11("opensc-pkcs11.so", true))
{
// Do something interesting
}
This is how you use Pkcs11Interop with pkcs11-logger:
Environment.SetEnvironmentVariable("PKCS11_LOGGER_ORIG_LIB", "opensc-pkcs11.so");
using (Pkcs11 pkcs11 = new Pkcs11("pkcs11-logger.so", true))
{
// Do something interesting
}
from pkcs11interop.
Thanks, jariq !
from pkcs11interop.
I've found a workaround for this issue and the fix was committed to the master git repository few minutes ago. From now on you don't have to use pkcs11-logger as a proxy library. Latest development version can be downloaded from https://github.com/jariq/Pkcs11Interop/archive/master.zip
from pkcs11interop.
Related Issues (20)
- Private key is not in certificate
- Method C_OpenSession returned CKR_CRYPTOKI_NOT_INITIALIZED
- Pkcs11Interop is not supported on this platform HOT 25
- Missing attribute CKA_NAME_HASH_ALGORITHM
- problem in Pkcs11Interop with new dll from epass 2003
- CKR_OPERATION_NOT_INITIALIZED in multithreaded application
- Missing param represents object handle
- Method C_Login returned CKR_SESSION_HANDLE_INVALID
- Incorrect CK_VERSION string value
- Get Key Value From HSM
- Not able to use C_Sign with yubikey PIV slot with CKA_ALWAYS_AUTHENTICATE HOT 5
- Linux : NativeULong as System.UInt32 causes error while accessing CK_GCM_PARAMS structure from PKCS11 standards HOT 2
- mac os compile problem MAUI .net core 7.0 how to fix ?
- SafeNet Data Objects HOT 7
- ComputeDigest/CreateDigestInfo - with newest Pkcs11Interop - how to ?
- C_Sign returned CKR_OPERATION_NOT_INITIALIZED in multithreaded application
- C_Encrypt with AES mechanism always returns with CKR_GENERAL_ERROR HOT 1
- C_FindObjects does return with nothing while running application in docker
- C_FindObjects does return with nothing while running application in docker HOT 3
- session.Decrypt returning garbage characters appended in PKCS#11 Multipart Decryption with Pkcs11Interop v 4.x.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkcs11interop.