Last active
May 26, 2019 12:23
-
-
Save mage1k99/b631d00137466ae76258df3ba2b4a629 to your computer and use it in GitHub Desktop.
Causes Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean cipherinitalize() { | |
try { | |
cipherObject = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_CBC + "/" + KeyProperties.ENCRYPTION_PADDING_PKCS7); | |
keyStoreObject.load(null); | |
SecretKey secretKeyObject = (SecretKey) keyStoreObject.getKey(key_name,null); | |
cipherObject.init(Cipher.ENCRYPT_MODE, secretKeyObject); | |
return true; | |
} catch (IOException e) { | |
e.printStackTrace(); | |
Log.e(TAG, "cipherinitalize: IOException error Occared", e); | |
return false; | |
} catch (CertificateException e) { | |
e.printStackTrace(); | |
Log.e(TAG, "cipherinitalize: Certificate Exception",e ); | |
return false; | |
} catch (NoSuchAlgorithmException e) { | |
e.printStackTrace(); | |
Log.e(TAG, "cipherinitalize: NoSuchAlgorithm exist", e); | |
return false; | |
} catch (UnrecoverableKeyException e) { | |
e.printStackTrace(); | |
Log.e(TAG, "cipherinitalize: UnrecoverableKey Exception", e); | |
return false; | |
} catch (InvalidKeyException e) { | |
e.printStackTrace(); | |
Log.e(TAG, "cipherinitalize: InvalidKeyException",e); | |
return false; | |
} catch (NoSuchPaddingException e) { | |
e.printStackTrace(); | |
Log.e(TAG, "cipherinitalize: NoSuchPaddingException",e ); | |
return false; | |
} catch (KeyStoreException e) { | |
e.printStackTrace(); | |
Log.e(TAG, "cipherinitalize: Keystore Exception", e); | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Above Code is a part of Cipherinit(As in the video by EDMT Dev ) method of fingerprint
At line 5 of the snippet The Error Occur Saying
java.security.InvalidKeyException: Only SecretKey is supported