Hello, I am trying to log in with a smart card. I keep getting the exception sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_TYPE_INVALID. I have tried several smart cards, and have gotten the same error every time.
My system is Windows 7 64-bit and my java version is 1.7.0_45. Code: try { File acpkcs64bit = new File("C:\\Progra~2\\ActivIdentity\\ActivClient\\acpkcs211.dll"); File pkcsProperties = null; if (acpkcs64bit.exists()) { pkcsProperties = new File("L:\\dev\\fullerene\\c60\\miami\\ui\\eas\\suite\\pkcs11.properties"); } if (pkcsProperties != null && pkcsProperties.exists()) { Security.addProvider(new sun.security.pkcs11.SunPKCS11(pkcsProperties.getPath())); } } catch (Exception e) { System.out.println("Exception: " + e.getMessage()); } try { KeyStore keyStore = KeyStore.getInstance("PKCS11"); keyStore.load(null, null); } catch (Exception e) { System.out.println("Failed attempt to login using PKI: " + (e.getMessage()!=null?e.getMessage():"")); } output: detailMessage: java.io.IOException: load failed cause: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_TYPE_INVALID My contents of pkcs11.properties are as follows: name = ActivClient library = C:\Progra~2\ActivIdentity\ActivClient\acpkcs211.dll When I run my IntelliJ configuration with the VM option -Djava.security.debug=sunpkcs11, I get the following output: SunPKCS11 loading L:\dev\fullerene\c60\miami\ui\eas\suite\pkcs11.properties Information for provider SunPKCS11-ActivClient Library info: cryptokiVersion: 2.20 manufacturerID: ActivIdentity flags: 0 libraryDescription: ActivIdentity Cryptoki libraryVersion: 1.00 All slots: 0 Slots with tokens: 0 Slot info for slot 0: slotDescription: SCM Microsystems Inc. SCR3310 USB Smart Card Reader 0 manufacturerID: Unknown flags: CKF_TOKEN_PRESENT | CKF_REMOVABLE_DEVICE | CKF_HW_SLOT hardwareVersion: 1.01 firmwareVersion: 1.01 Token info for token in slot 0: label: ActivIdentity ActivClient 0 manufacturerID: unknown manufacturer model: unknown card serialNumber: 3430303131443236 flags: CKF_RNG | CKF_LOGIN_REQUIRED | CKF_USER_PIN_INITIALIZED | CKF_PROTECTED_AUTHENTICATION_PATH | CKF_TOKEN_INITIALIZED ulMaxSessionCount: CK_EFFECTIVELY_INFINITE ulSessionCount: 0 ulMaxRwSessionCount: CK_EFFECTIVELY_INFINITE ulRwSessionCount: 0 ulMaxPinLen: 8 ulMinPinLen: 6 ulTotalPublicMemory: CK_UNAVAILABLE_INFORMATION ulFreePublicMemory: CK_UNAVAILABLE_INFORMATION ulTotalPrivateMemory: CK_UNAVAILABLE_INFORMATION ulFreePrivateMemory: CK_UNAVAILABLE_INFORMATION hardwareVersion: 1.01 firmwareVersion: 1.01 utcTime: Mechanism CKM_RSA_PKCS: ulMinKeySize: 512 ulMaxKeySize: 2048 flags: 2817 = CKF_HW | CKF_ENCRYPT | CKF_DECRYPT | CKF_SIGN Mechanism CKM_RSA_X_509: ulMinKeySize: 512 ulMaxKeySize: 2048 flags: 2817 = CKF_HW | CKF_ENCRYPT | CKF_DECRYPT | CKF_SIGN Mechanism CKM_SHA_1: ulMinKeySize: 4294967295 ulMaxKeySize: 4294967295 flags: 1024 = CKF_DIGEST Mechanism CKM_SHA256: ulMinKeySize: 4294967295 ulMaxKeySize: 4294967295 flags: 1024 = CKF_DIGEST Mechanism Unknown 0x00000000000002A0: ulMinKeySize: 4294967295 ulMaxKeySize: 4294967295 flags: 2048 = CKF_SIGN If anyone can help me with this error, I would appreciate it! I have google’d this error numerous times, and haven’t found an answer that helps. Thank you! Craig Larson ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140 _______________________________________________ opencryptoki-users mailing list opencryptoki-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opencryptoki-users