Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.pad
Interface IPad  view IPad download IPad.java

All Known Implementing Classes:
BasePad

public interface IPad

The basic visible methods of any padding algorithm.

Padding algorithms serve to pad and unpad byte arrays usually as the last step in an encryption or respectively a decryption operation. Their input buffers are usually those processed by instances of gnu.crypto.mode.IMode and/or gnu.crypto.cipher.IBlockCipher.


Method Summary
 void init(int bs)
          Initialises the padding scheme with a designated block size.
 java.lang.String name()
           
 byte[] pad(byte[] in, int offset, int length)
          Returns the byte sequence that should be appended to the designated input.
 void reset()
          Resets the scheme instance for re-initialisation and use with other characteristics.
 boolean selfTest()
          A basic symmetric pad/unpad test.
 int unpad(byte[] in, int offset, int length)
          Returns the number of bytes to discard from a designated input buffer.
 

Method Detail

name

public java.lang.String name()

init

public void init(int bs)
          throws java.lang.IllegalStateException
Initialises the padding scheme with a designated block size.


pad

public byte[] pad(byte[] in,
                  int offset,
                  int length)
Returns the byte sequence that should be appended to the designated input.


unpad

public int unpad(byte[] in,
                 int offset,
                 int length)
          throws WrongPaddingException
Returns the number of bytes to discard from a designated input buffer.


reset

public void reset()
Resets the scheme instance for re-initialisation and use with other characteristics. This method always succeeds.


selfTest

public boolean selfTest()
A basic symmetric pad/unpad test.