Module org.snmp4j

Class 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
    Author:
    Jochen Katz
    See Also:
    Serialized Form
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Salt

        protected Salt​()
        Default constructor, initializes the salt to a random value.
    • 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.