- java.lang.Object
-
- org.snmp4j.security.Salt
-
- All Implemented Interfaces:
java.io.Serializable
public class Salt extends java.lang.Object implements java.io.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
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static Salt
instance
private static LogAdapter
logger
private long
salt
private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
Salt()
Default constructor, initializes the salt to a random value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Salt
getInstance()
Get a initialized Salt object.long
getNext()
Get the next value of the salt by adding one to its current value.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
salt
private long salt
-
instance
private static Salt instance
-
logger
private static final LogAdapter logger
-
-
Method Detail
-
getInstance
public static Salt 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.
-
-