Package javacardx.framework.math
Class ParityBit
- java.lang.Object
-
- javacardx.framework.math.ParityBit
-
public final class ParityBit extends Object
TheParityBitclass is a utility to assist with DES key parity bit generation.- Since:
- 2.2.2
-
-
Constructor Summary
Constructors Constructor Description ParityBit()Intended to be package visible.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidset(byte[] bArray, short bOff, short bLen, boolean isEven)Inserts the computed parity bit of the specified type as the last bit(LSB) in each of the bytes of the specified byte array.
-
-
-
Method Detail
-
set
public static void set(byte[] bArray, short bOff, short bLen, boolean isEven)Inserts the computed parity bit of the specified type as the last bit(LSB) in each of the bytes of the specified byte array. The parity is computed over the first(MS) 7 bits of each byte. The incoming last bit of each byte is ignored.Note:
- If
bOfforbLenis negative anArrayIndexOutOfBoundsExceptionexception is thrown. - If
bLenparameter is equal to 0 no parity bits are inserted. - If
bOff+bLenis greater thanbArray.length, the length of thebArrayarray aArrayIndexOutOfBoundsExceptionexception is thrown and no parity bits are inserted. - If
bArrayparameter isnullaNullPointerExceptionexception is thrown.
- Parameters:
bArray- input/output byte arraybOff- offset within byte array to start setting parity onbLen- byte length of input/output bytesisEven-trueif even parity is required andfalseif odd parity is required- Throws:
NullPointerException- ifbArrayisnullArrayIndexOutOfBoundsException- if accessing the input array would cause access of data outside array bounds or ifbLenis negative
- If
-
-