Code example for InvalidKeyException

Methods: printStackTrace

0
		} catch (NoSuchAlgorithmException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (InvalidKeyException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
		return "error"; 
 
	} 
 
	public static String encodeBase64(String data) {
		return Base64.encodeToString(data.getBytes(), 0);
	} 
 
	public static String encodeURL(String url) {
		url = url.replace("\n", "");
		url = url.replace("+", "%2B");
		url = url.replace(" ", "%20");
		return url;
	}