Save This Page
Home » openjdk-7 » com.sun.crypto » provider » [javadoc | source]
com.sun.crypto.provider
abstract class: FeedbackCipher [javadoc | source]
java.lang.Object
   com.sun.crypto.provider.FeedbackCipher

Direct Known Subclasses:
    CipherTextStealing, CipherFeedback, CounterMode, CipherBlockChaining, ElectronicCodeBook, PCBC, OutputFeedback

This class represents a block cipher in one of its modes. It wraps a SymmetricCipher maintaining the mode state and providing the capability to encrypt amounts of data larger than a single block.
Field Summary
final  SymmetricCipher embeddedCipher     
final  int blockSize     
 byte[] iv     
Constructor:
 FeedbackCipher(SymmetricCipher embeddedCipher) 
Method from com.sun.crypto.provider.FeedbackCipher Summary:
decrypt,   decryptFinal,   encrypt,   encryptFinal,   getBlockSize,   getEmbeddedCipher,   getFeedback,   getIV,   init,   reset,   restore,   save
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.crypto.provider.FeedbackCipher Detail:
 abstract  void decrypt(byte[] cipher,
    int cipherOffset,
    int cipherLen,
    byte[] plain,
    int plainOffset)
    Performs decryption operation.

    The input cipher, starting at cipherOffset and ending at (cipherOffset+cipherLen-1), is decrypted. The result is stored in plain, starting at plainOffset.

    The subclass that implements Cipher should ensure that init has been called before this method is called.

  void decryptFinal(byte[] cipher,
    int cipherOffset,
    int cipherLen,
    byte[] plain,
    int plainOffset) throws IllegalBlockSizeException 
    Performs decryption operation for the last time.

    NOTE: For cipher feedback modes which does not perform special handling for the last few blocks, this is essentially the same as encrypt(...). Given most modes do not do special handling, the default impl for this method is to simply call decrypt(...).

 abstract  void encrypt(byte[] plain,
    int plainOffset,
    int plainLen,
    byte[] cipher,
    int cipherOffset)
    Performs encryption operation.

    The input plain, starting at plainOffset and ending at (plainOffset+plainLen-1), is encrypted. The result is stored in cipher, starting at cipherOffset.

    The subclass that implements Cipher should ensure that init has been called before this method is called.

  void encryptFinal(byte[] plain,
    int plainOffset,
    int plainLen,
    byte[] cipher,
    int cipherOffset) throws IllegalBlockSizeException 
    Performs encryption operation for the last time.

    NOTE: For cipher feedback modes which does not perform special handling for the last few blocks, this is essentially the same as encrypt(...). Given most modes do not do special handling, the default impl for this method is to simply call encrypt(...).

 final int getBlockSize() 
    Gets the block size of the embedded cipher.
 final SymmetricCipher getEmbeddedCipher() 
 abstract String getFeedback()
    Gets the name of the feedback mechanism
 final byte[] getIV() 
    Gets the initialization vector.
 abstract  void init(boolean decrypting,
    String algorithm,
    byte[] key,
    byte[] iv) throws InvalidKeyException
    Initializes the cipher in the specified mode with the given key and iv.
 abstract  void reset()
    Resets the iv to its original value. This is used when doFinal is called in the Cipher class, so that the cipher can be reused (with its original iv).
 abstract  void restore()
    Restores the content of this cipher to the previous saved one.
 abstract  void save()
    Save the current content of this cipher.