Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have made keyStore in java1.4 using this code.

public static void main(String[] args )
      throws IOException, DocumentException, GeneralSecurityException {
String pkcs11Config = "name=eToken\nlibrary=C://WINDOWS//system32//eTPKCS11.dll";
java.io.ByteArrayInputStream pkcs11ConfigStream = new java.io.ByteArrayInputStream(pkcs11Config.getBytes());
sun.security.pkcs11.SunPKCS11 providerPKCS11 = new   sun.security.pkcs11.SunPKCS11(pkcs11ConfigStream);
java.security.Security.addProvider(providerPKCS11);

// Get provider KeyStore and login with PIN
String pin = "123456";
 java.security.KeyStore keyStore =java.security.KeyStore.getInstance("PKCS11", providerPKCS11);
keyStore.load(null, pin.toCharArray());

// Enumerate items (certificates and private keys) in the KeyStore
java.util.Enumeration<String> aliases = keyStore.aliases();
String alias=null;
while (aliases.hasMoreElements()) {
 alias = aliases.nextElement();
System.out.println(alias);

 }} 


But I have get an error

Error(2,28): cannot access class sun.security.pkcs11.SunPKCS11; class file has wrong version 49.0, should be 45.3 or 46.0 or 47.0 or 48.0`


Please Tell me the solution. How can I download the class of version below 49 like 48 etc.
Posted
Comments
Richard MacCutchan 3-Sep-15 10:03am    
Upgrade your JDK to the latest version.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900