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