Class HashUtils

java.lang.Object
org.bouncycastle.bcpg.HashUtils

public class HashUtils extends Object
  • Constructor Details

    • HashUtils

      public HashUtils()
  • Method Details

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