org.apache.sshd.common.cipher
Class BaseCipher
java.lang.Object
org.apache.sshd.common.cipher.BaseCipher
- All Implemented Interfaces:
- Cipher
- Direct Known Subclasses:
- AES128CBC, AES128CTR, AES192CBC, AES256CBC, AES256CTR, ARCFOUR128, ARCFOUR256, BlowfishCBC, TripleDESCBC
public class BaseCipher
- extends java.lang.Object
- implements Cipher
Base class for all Cipher implementations delegating to the JCE provider.
- Author:
- Apache MINA SSHD Project
| Nested classes/interfaces inherited from interface org.apache.sshd.common.Cipher |
Cipher.Mode |
|
Constructor Summary |
BaseCipher(int ivsize,
int bsize,
java.lang.String algorithm,
java.lang.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 |
ivsize
protected final int ivsize
bsize
protected final int bsize
algorithm
protected final java.lang.String algorithm
transformation
protected final java.lang.String transformation
cipher
protected javax.crypto.Cipher cipher
BaseCipher
public BaseCipher(int ivsize,
int bsize,
java.lang.String algorithm,
java.lang.String transformation)
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 java.lang.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:
java.lang.Exception
update
public void update(byte[] input,
int inputOffset,
int inputLen)
throws java.lang.Exception
- Description copied from interface:
Cipher
- Performs in-place encryption or decryption on the given data.
- Specified by:
update in interface Cipher
- Throws:
java.lang.Exception
Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.