java.lang.Object
org.snmp4j.security.Salt
- All Implemented Interfaces:
Serializable
Class that holds a 64 bit salt value for crypto operations.
This class tries to use the SecureRandom class to initialize the salt value. If SecureRandom is not available the class Random is used.
- Version:
- 1.0
- Author:
- Jochen Katz
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
Salt()
Default constructor, initializes the salt to a random value. -
Method Summary
-
Constructor Details
-
Salt
protected Salt()Default constructor, initializes the salt to a random value.
-
-
Method Details
-
getInstance
Get a initialized Salt object.- Returns:
- the Salt object
-
getNext
public long getNext()Get the next value of the salt by adding one to its current value. This might result in a predictable salt value if it is not combined with other somehow unpredictable (random) data.- Returns:
- previous value increased by one.
-