com.ibm.crypto.fips.provider
Class SigUtil
- java.lang.Object
-
- com.ibm.crypto.fips.provider.SigUtil
-
public class SigUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description SigUtil()
-
Method Summary
Methods Modifier and Type Method and Description static java.lang.String
byteArrayToHexString(byte[] b)
Converts a Byte Array into a Hex Stringstatic void
IncLastByte(byte[] buf)
Increments the last byte.static byte[]
padWithZeros(byte[] bytes)
static byte[]
padWithZeros(byte[] bytes, int len)
Pad with zeros if necessarystatic byte[]
stripOffSignByte(byte[] bytes)
You'd better only do this if you KNOW that this is a positive number!!! BigInteger.toByteArray() will output an extra leading 00 byte if the high-order bit is on in the first nibble of output.
-
-
-
Method Detail
-
stripOffSignByte
public static byte[] stripOffSignByte(byte[] bytes)
You'd better only do this if you KNOW that this is a positive number!!! BigInteger.toByteArray() will output an extra leading 00 byte if the high-order bit is on in the first nibble of output. This will really hose up HASHes.- Parameters:
bytes
- byte array with potential extra byte of zero in front- Returns:
-
padWithZeros
public static byte[] padWithZeros(byte[] bytes)
-
padWithZeros
public static byte[] padWithZeros(byte[] bytes, int len)
Pad with zeros if necessary- Parameters:
bytes
-len
-- Returns:
-
byteArrayToHexString
public static java.lang.String byteArrayToHexString(byte[] b)
Converts a Byte Array into a Hex String
-
IncLastByte
public static void IncLastByte(byte[] buf)
Increments the last byte. Overflows to Zero after reaching the maximum 0XFFFFF etc.- Parameters:
buf
-
-
-