Code example for InvalidKeyException

Methods: printStackTrace

0
			publicKeyCipher = Cipher.getInstance("RSA/ECB/PKCS1PADDING");
			publicKeyCipher.init(Cipher.ENCRYPT_MODE, publicKey);
			result = publicKeyCipher.doFinal(key);
		} catch (InvalidKeyException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (IllegalBlockSizeException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (BadPaddingException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (NoSuchPaddingException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
		Log.i("RSA", "ENCTRYPTED...");
		return result;