Module org.snmp4j

Class Salt

java.lang.Object
org.snmp4j.security.Salt
All Implemented Interfaces:
Serializable

public class Salt extends Object implements 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • salt

      private long salt
    • instance

      private static Salt instance
    • logger

      private static final LogAdapter logger
  • Constructor Details

    • Salt

      protected Salt()
      Default constructor, initializes the salt to a random value.
  • Method Details

    • 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.