@@ -72,11 +72,26 @@ inline fs::path lithuanianPKCS11ModulePath()
7272inline fs::path croatianPkcs11ModulePath ()
7373{
7474#ifdef _WIN32
75- return programFilesPath () / L" AKD/eID Middleware/pkcs11/AkdEidPkcs11_64.dll" ;
75+ fs::path certiliaPath =
76+ programFilesPath () / L" AKD/Certilia Middleware/pkcs11/AkdEidPkcs11_64.dll" ;
77+ fs::path eidPath = programFilesPath () / L" AKD/eID Middleware/pkcs11/AkdEidPkcs11_64.dll" ;
78+ return fs::exists (certiliaPath) ? certiliaPath : eidPath;
7679#elif defined __APPLE__
77- return " /Library/AKD/eID Middleware/pkcs11/libEidPkcs11.so" ; // NB! Not tested.
80+ // The driver provider installs the library to /usr/local/lib/pkcs11, but
81+ // sandboxed applications cannot access /usr/local/ due to macOS restrictions.
82+ // To make the solution work, the library (libEidPkcs11.dylib) and License.bin must be
83+ // copied to /Library/AKD/pkcs11, which is accessible in sandboxed environments:
84+ //
85+ // sudo mkdir -p /Library/AKD/pkcs11
86+ // sudo cp -a /usr/local/lib/pkcs11/{libEidPkcs11.dylib,License.bin} /Library/AKD/pkcs11/
87+ //
88+ // This workaround is required until the driver provider addresses the issue.
89+ // NB! This is not tested.
90+ return " /Library/AKD/pkcs11/libEidPkcs11.dylib" ;
7891#else // Linux
79- return " /usr/lib/akd/eidmiddleware/pkcs11/libEidPkcs11.so" ;
92+ fs::path certiliaPath = " /usr/lib/akd/certiliamiddleware/pkcs11/libEidPkcs11.so" ;
93+ fs::path eidPath = " /usr/lib/akd/eidmiddleware/pkcs11/libEidPkcs11.so" ;
94+ return fs::exists (certiliaPath) ? certiliaPath : eidPath;
8095#endif
8196}
8297
0 commit comments