org.apache.sshd.common.cipher
Class BaseCipher

java.lang.Object
  extended by org.apache.sshd.common.cipher.BaseCipher
All Implemented Interfaces:
Cipher
Direct Known Subclasses:
AES128CBC, AES192CBC, AES256CBC, BlowfishCBC, TripleDESCBC

public class BaseCipher
extends Object
implements Cipher

Base class for all Cipher implementations delegating to the JCE provider.

Author:
Apache MINA SSHD Project

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.sshd.common.Cipher
Cipher.Mode
 
Constructor Summary
BaseCipher(int ivsize, int bsize, String algorithm, String transformation)
           
 
Method Summary
 int getBlockSize()
          Retrieves the block size for this cipher
 int getIVSize()
          Retrieves the size of the initialization vector
 void init(Cipher.Mode mode, byte[] key, byte[] iv)
          Initialize the cipher for encryption or decryption with the given private key and initialization vector
 void update(byte[] input, int inputOffset, int inputLen)
          Performs in-place encryption or decryption on the given data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseCipher

public BaseCipher(int ivsize,
                  int bsize,
                  String algorithm,
                  String transformation)
Method Detail

getIVSize

public int getIVSize()
Description copied from interface: Cipher
Retrieves the size of the initialization vector

Specified by:
getIVSize in interface Cipher
Returns:

getBlockSize

public int getBlockSize()
Description copied from interface: Cipher
Retrieves the block size for this cipher

Specified by:
getBlockSize in interface Cipher
Returns:

init

public void init(Cipher.Mode mode,
                 byte[] key,
                 byte[] iv)
          throws Exception
Description copied from interface: Cipher
Initialize the cipher for encryption or decryption with the given private key and initialization vector

Specified by:
init in interface Cipher
Throws:
Exception

update

public void update(byte[] input,
                   int inputOffset,
                   int inputLen)
            throws Exception
Description copied from interface: Cipher
Performs in-place encryption or decryption on the given data.

Specified by:
update in interface Cipher
Throws:
Exception


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.