Class HashUtils


  • public class HashUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      HashUtils()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static int getV6SignatureSaltSizeInBytes​(int hashAlgorithm)
      Return the length of the salt per hash algorithm, used in OpenPGP v6 signatures.
      boolean saltSizeMatchesSpec​(int hashAlgorithm, int saltSize)
      Return true, if the encountered saltLength matches the value the specification gives for the hashAlgorithm.
      • Methods inherited from class java.lang.Object

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

      • HashUtils

        public HashUtils()
    • Method Detail

      • getV6SignatureSaltSizeInBytes

        public static int getV6SignatureSaltSizeInBytes​(int hashAlgorithm)
        Return the length of the salt per hash algorithm, used in OpenPGP v6 signatures.
        Parameters:
        hashAlgorithm - hash algorithm tag
        Returns:
        size of the salt for the given hash algorithm in bytes
        See Also:
        OpenPGP - Salt Size declarations
      • saltSizeMatchesSpec

        public boolean saltSizeMatchesSpec​(int hashAlgorithm,
                                           int saltSize)
        Return true, if the encountered saltLength matches the value the specification gives for the hashAlgorithm.
        Parameters:
        hashAlgorithm - hash algorithm tag
        saltSize - encountered salt size
        Returns:
        true if the encountered size matches the spec