Package org.bouncycastle.util
Class Fingerprint
java.lang.Object
org.bouncycastle.util.Fingerprint
Basic 20 byte finger print class.
-
Constructor Summary
ConstructorsConstructorDescriptionFingerprint
(byte[] source) Base constructor - use SHAKE-256 (160 bits).Fingerprint
(byte[] source, int bitLength) Constructor with length - use SHAKE-256 (bitLength bits). -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
calculateFingerprint
(byte[] input) Return a byte array containing a calculated fingerprint for the passed in input data.static byte[]
calculateFingerprint
(byte[] input, int bitLength) Return a byte array containing a calculated fingerprint for the passed in input data.boolean
byte[]
int
hashCode()
toString()
-
Constructor Details
-
Fingerprint
public Fingerprint(byte[] source) Base constructor - use SHAKE-256 (160 bits). This is the recommended one as it is also produced by the FIPS API.- Parameters:
source
- original data to calculate the fingerprint from.
-
Fingerprint
public Fingerprint(byte[] source, int bitLength) Constructor with length - use SHAKE-256 (bitLength bits). This is the recommended one as it is also produced by the FIPS API.- Parameters:
source
- original data to calculate the fingerprint from.
-
-
Method Details
-
getFingerprint
public byte[] getFingerprint() -
toString
-
equals
-
hashCode
public int hashCode() -
calculateFingerprint
public static byte[] calculateFingerprint(byte[] input) Return a byte array containing a calculated fingerprint for the passed in input data. This calculation is compatible with the BC FIPS API.- Parameters:
input
- data to base the fingerprint on.- Returns:
- a byte array containing a 160 bit fingerprint.
-
calculateFingerprint
public static byte[] calculateFingerprint(byte[] input, int bitLength) Return a byte array containing a calculated fingerprint for the passed in input data. This calculation is compatible with the BC FIPS API.- Parameters:
input
- data to base the fingerprint on.bitLength
- bit length of finger print to be produced.- Returns:
- a byte array containing a 20 byte fingerprint.
-