Bouncy Castle Cryptography Library 1.81

org.bouncycastle.bcpg
Class HashUtils

java.lang.Object
  extended byorg.bouncycastle.bcpg.HashUtils

public class HashUtils
extends java.lang.Object


Constructor Summary
HashUtils()
           
 
Method Summary
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

Bouncy Castle Cryptography Library 1.81