diff --git a/src/main/java/com/amdelamar/jotp/type/HOTP.java b/src/main/java/com/amdelamar/jotp/type/HOTP.java index 533c1fd..3a12eb3 100644 --- a/src/main/java/com/amdelamar/jotp/type/HOTP.java +++ b/src/main/java/com/amdelamar/jotp/type/HOTP.java @@ -100,8 +100,8 @@ protected static int checksum(long num, int digits) { * @param crypto * the crypto function to use * @return An OTP code. - * @throws NoSuchAlgorithmException - * @throws InvalidKeyException + * @throws NoSuchAlgorithmException if hmac sha1 is not available + * @throws InvalidKeyException if given key is inappropriate for this mac */ protected static String generateHotp(byte[] secret, long movingFactor, diff --git a/src/main/java/com/amdelamar/jotp/type/TOTP.java b/src/main/java/com/amdelamar/jotp/type/TOTP.java index c98984e..85dd6e8 100644 --- a/src/main/java/com/amdelamar/jotp/type/TOTP.java +++ b/src/main/java/com/amdelamar/jotp/type/TOTP.java @@ -71,13 +71,13 @@ protected static byte[] hexStringToBytes(String hex) { * the shared secret, HEX encoded * @param time * a value that reflects a time - * @param returnDigits + * @param digits * number of digits to return * @param crypto * the crypto function to use * @return numeric String in base 10 that includes digits - * @throws NoSuchAlgorithmException - * @throws InvalidKeyException + * @throws NoSuchAlgorithmException if hmac sha1 is not available + * @throws InvalidKeyException if given key is inappropriate for this mac */ protected static String generateTotp(String key, String time, int digits, String crypto) throws InvalidKeyException, NoSuchAlgorithmException { diff --git a/src/main/java/com/amdelamar/jotp/util/Utils.java b/src/main/java/com/amdelamar/jotp/util/Utils.java index f95ee85..e59fcf3 100644 --- a/src/main/java/com/amdelamar/jotp/util/Utils.java +++ b/src/main/java/com/amdelamar/jotp/util/Utils.java @@ -22,8 +22,9 @@ private Utils() { * the bytes to use for the HMAC key * @param text * the message or text to be authenticated - * @throws NoSuchAlgorithmException - * @throws InvalidKeyException + * @return hash byte array + * @throws NoSuchAlgorithmException if hmac sha1 is not available + * @throws InvalidKeyException if given key is inappropriate for this mac */ public static byte[] hmac(String alg, byte[] keyBytes, byte[] text) throws NoSuchAlgorithmException, InvalidKeyException {