Package com.codingchili.core.security
Class SecretFactory
java.lang.Object
com.codingchili.core.security.SecretFactory
Generates and verifies secret keys.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
SecretFactory
public SecretFactory()
-
-
Method Details
-
generate
Generate a random secret of the given length.- Parameters:
bytes
- length of the secret in bytes.- Returns:
- number of random bytes specified.
-
verify
Verifies that two given secrets are equal.- Parameters:
origin
- the kept secret.clone
- the secret to verify.- Returns:
- true if an exact match is found.
-