|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Padding interface. This interface is implemented by general-purpose padding schemes, such as the one described in PKCS#5.
| Method Summary | |
|---|---|
int |
pad(byte[] in,
int off,
int len)
Performs padding for the given data input. |
int |
padLength(int len)
Determines how long the padding will be for a given input length. |
void |
padWithLen(byte[] in,
int off,
int len)
Adds the given number of padding bytes to the data input. |
int |
unpad(byte[] in,
int off,
int len)
Returns the index where padding starts. |
| Method Detail |
public int pad(byte[] in,
int off,
int len)
throws javax.crypto.ShortBufferException
in - the input buffer with the data to padoff - the offset in in where the data to pad startslen - the length of the data to padjavax.crypto.ShortBufferException - if in is too small to hold
the padding bytes
public void padWithLen(byte[] in,
int off,
int len)
throws javax.crypto.ShortBufferException
in - the input buffer with the data to padthe - offset in in where the padding bytes
are appendedlen - the number of padding bytes to addjavax.crypto.ShortBufferException - if in is too small to hold
the padding bytes
public int unpad(byte[] in,
int off,
int len)
Given a buffer with data and their padding, this method returns the index where the padding starts.
in - the buffer with the data and their paddingoff - the offset in in where the data startslen - the length of the data and their paddingpublic int padLength(int len)
len - the length of the data to pad
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||