Code example for NoSuchAlgorithmException

Methods: toString

0
			keyFac = SecretKeyFactory
					.getInstance(algorithm,"BC");
		} catch (NoSuchAlgorithmException e) {
			Log.e(TAG,"CryptoHelper(): "+e.toString());
		} catch (NoSuchProviderException e) {
			Log.e(TAG,"CryptoHelper(): "+e.toString());		
		} 
	} 
 
	/** 
	 * Generate a random salt for use with the cipher. 
	 *  
	 * @author Randy McEoin 
	 * @return String version of the 8 byte salt 
	 */ 
	public static String generateSalt() throws NoSuchAlgorithmException {
		byte[] salt = new byte[8];
		SecureRandom sr;
		try { 
			sr = SecureRandom.getInstance("SHA1PRNG");
			sr.nextBytes(salt);