Base64Decoder error [message #1695986] |
Wed, 20 May 2015 17:46  |
Eclipse User |
|
|
|
Greetings,
For the following code I am getting an error message. I have no clue what to do.
public String decrypt(String password) {
try {
// create the key and parameter spec
KeySpec keySpec = new PBEKeySpec(password.toCharArray(), salt, interactions);
SecretKey key = SecretKeyFactory.getInstance(keyFormat).generateSecret(keySpec);
AlgorithmParameterSpec paramSpec = new PBEParameterSpec(salt, interactions);
// create the cipher
Cipher dcipher = Cipher.getInstance(key.getAlgorithm());
dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
byte[] dec = null;
try {
dec = Base64Coder.decode(cryptic);
} catch(IllegalArgumentException ex) {
// decode legacy files encoded with sun encoder
dec = new sun.misc.BASE64Decoder().decodeBuffer(cryptic);
}
byte[] bytes = dcipher.doFinal(dec);
return new String(bytes, encoding);
} catch(Exception ex) {
ex.printStackTrace();
}
return null;
}
The error is indicated by underline on the following line
dec = new sun.misc.BASE64Decoder().decodeBuffer(cryptic);
The error message is as follows:
Access restriction: The type 'BASE64Decoder" is not API (restriction on required library '/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/lib/rd.jar')
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06641 seconds