Code example for UndeclaredThrowableException

0
			hmac = Mac.getInstance(crypto);
			SecretKeySpec macKey = new SecretKeySpec(keyBytes, "RAW");
			hmac.init(macKey);
			return hmac.doFinal(text);
		} catch (GeneralSecurityException gse) {
			throw new UndeclaredThrowableException(gse);
		} 
	} 
 
	/** 
	 * This method generates a TOTP value for the given set of parameters. 
	 *  
	 * @param key 
	 *            : the shared secret 
	 * @param time 
	 *            : a value that reflects a time 
	 * @param digits 
	 *            : number of digits to return 
	 * @param crypto 
	 *            : the crypto function to use