Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
M3DZIK committed Feb 28, 2024
1 parent 4afb927 commit 5a3fc55
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/main/java/dev/medzik/otp/HOTPGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class HOTPGenerator {
private OTPParameters params;

/**
* Generate HOTP code from the given parameters for the given counter.
* Generates HOTP code from the given parameters for the given counter.
*
* @param params The OTP parameters.
* @param counter The HOTP counter.
Expand All @@ -30,9 +30,10 @@ public static String generate(OTPParameters params, long counter) throws Illegal
}

/**
* Generate HOTP code from the OTPAuth URL.
* Generates HOTP code from the OTPAuth URL.
*
* @param url The OTPAuth URL.
* @param counter The HOTP counter.
* @return The HOTP code.
* @throws URISyntaxException If the OTP type is not TOTP.
*/
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/dev/medzik/otp/OTPParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public OTPParameters build() throws IllegalArgumentException {
}

/**
* Encode the parameters as OTPAuth URL.
* Encodes the parameters as OTPAuth URL.
*
* @return The encoded OTPAuth URL.
*/
Expand Down Expand Up @@ -176,15 +176,17 @@ public final static class Secret {
private final byte[] value;

/**
* Generate OTP secret with default number of bits.
* Generates OTP secret with default number of bits.
*
* @return The randomly generated secret.
*/
public static Secret generate() {
return generate(DEFAULT_BITS);
}

/**
* Generate OTP secret with specified number of bits.
* Generates OTP secret with specified number of bits.
*
* @param bits The number of bits to generate.
* @return The randomly generated secret.
*/
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/dev/medzik/otp/OTPType.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.PackagePrivate;

@AllArgsConstructor
@Getter
Expand All @@ -11,7 +12,8 @@ public enum OTPType {

private final String value;

public static OTPType get(String value) throws IllegalArgumentException {
@PackagePrivate
static OTPType get(String value) throws IllegalArgumentException {
switch (value.toLowerCase()) {
case "totp":
return TOTP;
Expand Down

0 comments on commit 5a3fc55

Please sign in to comment.