Package org.bouncycastle.bcpg
Class HashUtils
- java.lang.Object
-
- org.bouncycastle.bcpg.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.
-
-
-
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 tagsaltSize
- encountered salt size- Returns:
- true if the encountered size matches the spec
-
-