Methods Summary |
---|
public int | addPadding(byte[] in, int inOff)add the pad bytes to the passed in block, returning the
number of bytes added.
int added = (in.length - inOff);
in [inOff]= (byte) 0x80;
inOff ++;
while (inOff < in.length)
{
in[inOff] = (byte) 0;
inOff++;
}
return added;
|
public java.lang.String | getPaddingName()Return the name of the algorithm the padder implements.
return "ISO7816-4";
|
public void | init(java.security.SecureRandom random)Initialise the padder.
// nothing to do.
|
public int | padCount(byte[] in)return the number of pad bytes present in the block.
int count = in.length - 1;
while (count > 0 && in[count] == 0)
{
count--;
}
if (in[count] != (byte)0x80)
{
throw new InvalidCipherTextException("pad block corrupted");
}
return in.length - count;
|