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
Author:
Jochen Katz
See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Default constructor, initializes the salt to a random value.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Salt
    Get a initialized Salt object.
    long
    Get the next value of the salt by adding one to its current value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.