{"action":"created","issue":{"url":"https://api.github.com/repos/OpenSC/OpenSC/issues/495","labels_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/495/comments","events_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/495/events","html_url":"https://github.com/OpenSC/OpenSC/issues/495","id":97024767,"number":495,"title":"Can't init KeyStore via Sun PKCS11 Provider","user":{"login":"frapontillo","id":1140238,"avatar_url":"https://avatars.githubusercontent.com/u/1140238?v=3","gravatar_id":"","url":"https://api.github.com/users/frapontillo","html_url":"https://github.com/frapontillo","followers_url":"https://api.github.com/users/frapontillo/followers","following_url":"https://api.github.com/users/frapontillo/following{/other_user}","gists_url":"https://api.github.com/users/frapontillo/gists{/gist_id}","starred_url":"https://api.github.com/users/frapontillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frapontillo/subscriptions","organizations_url":"https://api.github.com/users/frapontillo/orgs","repos_url":"https://api.github.com/users/frapontillo/repos","events_url":"https://api.github.com/users/frapontillo/events{/privacy}","received_events_url":"https://api.github.com/users/frapontillo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenSC/OpenSC/labels/Support","name":"Support","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-24T10:45:26Z","updated_at":"2015-08-26T15:45:55Z","closed_at":null,"body":"I am trying to access the smartcard KeyStore via the OpenSC DLL on Windows 8.1 x64.\r\n\r\nI am therefore building the Provider via the following config file:\r\n```\r\nname = SmartCard\r\nlibrary = C:\\Windows\\SysWOW64\\opensc-pkcs11.dll\r\nslotListIndex = 0\r\n```\r\n\r\nThe provider gets built with the following information:\r\n```\r\n0 = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry@1016} \"Provider.id info\" -> \"SunPKCS11-SmartCard using library C:\\Windows\\SysWOW64\\opensc-pkcs11.dll\"\r\n1 = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry@1017} \"Provider.id className\" -> \"sun.security.pkcs11.SunPKCS11\"\r\n2 = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry@1018} \"Provider.id version\" -> \"1.8\"\r\n3 = {java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$UnmodifiableEntry@1019} \"Provider.id name\" -> \"SunPKCS11-SmartCard\"\r\n```\r\n\r\nThe thing is, if I use the original closed-source driver by Bit4ID (`bit4ipki.dll`), I end up having much more (48) entries in the set, among which there's also a PKCS11 KeyStore.\r\n\r\nTherefore, the first line always throws an Exception, since no implementation for KeyStore can be found:\r\n```\r\nObject[] objs = Security.getImpl(type, \"KeyStore\", provider);\r\nreturn new KeyStore((KeyStoreSpi)objs[0], (Provider)objs[1], type);\r\n```\r\n\r\nIs this a solvable issue? What does it depend on?\r\n\r\nMy environment is:\r\n```\r\nC:\\Program Files (x86)\\OpenSC Project\\OpenSC\\tools>opensc-tool -l\r\n# Detected readers (pcsc)\r\nNr.  Card  Features  Name\r\n0    Yes             CASTLES EZ100PU 0\r\n\r\nC:\\Program Files (x86)\\OpenSC Project\\OpenSC\\tools>opensc-tool -a\r\nUsing reader with a card: CASTLES EZ100PU 0\r\n3b:ff:18:00:00:81:31:fe:45:00:6b:04:05:07:00:01:21:01:43:4e:53:10:31:80:5f\r\n\r\nC:\\Program Files (x86)\\OpenSC Project\\OpenSC\\tools>opensc-tool -n\r\nUsing reader with a card: CASTLES EZ100PU 0\r\nCNS card\r\n```"},"comment":{"url":"https://api.github.com/repos/OpenSC/OpenSC/issues/comments/135074170","html_url":"https://github.com/OpenSC/OpenSC/issues/495#issuecomment-135074170","issue_url":"https://api.github.com/repos/OpenSC/OpenSC/issues/495","id":135074170,"user":{"login":"frapontillo","id":1140238,"avatar_url":"https://avatars.githubusercontent.com/u/1140238?v=3","gravatar_id":"","url":"https://api.github.com/users/frapontillo","html_url":"https://github.com/frapontillo","followers_url":"https://api.github.com/users/frapontillo/followers","following_url":"https://api.github.com/users/frapontillo/following{/other_user}","gists_url":"https://api.github.com/users/frapontillo/gists{/gist_id}","starred_url":"https://api.github.com/users/frapontillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frapontillo/subscriptions","organizations_url":"https://api.github.com/users/frapontillo/orgs","repos_url":"https://api.github.com/users/frapontillo/repos","events_url":"https://api.github.com/users/frapontillo/events{/privacy}","received_events_url":"https://api.github.com/users/frapontillo/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T15:45:55Z","updated_at":"2015-08-26T15:45:55Z","body":"@martinpaljak I assume you mean `pkcs11-tool -D`, right?\r\n\r\nHow can I debug `src/libopensc/pkcs15-itacns.c` instead?"}}