Class PKCS5Padding
- java.lang.Object
-
- com.fortanix.sdkms.jce.provider.paddings.PKCS5Padding
-
-
Constructor Summary
Constructors Constructor Description PKCS5Padding(int blockSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
int
getPaddingLength(int inputLength)
void
pad(ByteArrayOutputStream in)
Adds the given number of padding bytes to the data input.byte[]
unpad(byte[] in)
Returns the index where the padding starts.
-
-
-
Method Detail
-
pad
public void pad(ByteArrayOutputStream in)
Adds the given number of padding bytes to the data input. The value of the padding bytes is determined by the specific padding mechanism that implements this interface.- Specified by:
pad
in interfaceIPadding
- Parameters:
in
- the input buffer with the data to padoff
- the offset inin
where the padding bytes are appendedlen
- the number of padding bytes to add- Throws:
ShortBufferException
- ifin
is too small to hold the padding bytes
-
unpad
public byte[] unpad(byte[] in)
Returns the index where the padding starts.Given a buffer with padded data, this method returns the index where the padding starts.
-
getPaddingLength
public int getPaddingLength(int inputLength)
- Specified by:
getPaddingLength
in interfaceIPadding
-
-