com.maverick.ssh.components.jce
Class AbstractJCECipher

java.lang.Object
  extended by com.maverick.ssh.components.SshCipher
      extended by com.maverick.ssh.components.jce.AbstractJCECipher
Direct Known Subclasses:
AES128Cbc, AES128Ctr, AES192Cbc, AES192Ctr, AES256Cbc, AES256Ctr, ArcFour, ArcFour128, ArcFour256, BlowfishCbc, Ssh1Des, TripleDesCbc, TripleDesCtr

public class AbstractJCECipher
extends SshCipher

An abstract base class for defining SSH ciphers which use a JCE provider instead of the internal Maverick Crypto provider.

Author:
Lee David Painter

Field Summary
 
Fields inherited from class com.maverick.ssh.components.SshCipher
DECRYPT_MODE, ENCRYPT_MODE
 
Constructor Summary
AbstractJCECipher(String spec, String keyspec, int keylength, String algorithm)
           
 
Method Summary
 int getBlockSize()
           
 String getProvider()
           
 void init(int mode, byte[] iv, byte[] keydata)
           
 void transform(byte[] buf, int start, byte[] output, int off, int len)
           
 
Methods inherited from class com.maverick.ssh.components.SshCipher
getAlgorithm, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJCECipher

public AbstractJCECipher(String spec,
                         String keyspec,
                         int keylength,
                         String algorithm)
                  throws IOException
Parameters:
spec - the value passed into Cipher.getInstance() that specifies the specification of the cipher; for example "Blowfish/CBC/NoPadding"
keyspec - the value passed into the constructor of SecretKeySpec.
keylength - int the length in bytes of the key
Throws:
IOException
Method Detail

transform

public void transform(byte[] buf,
                      int start,
                      byte[] output,
                      int off,
                      int len)
               throws IOException
Specified by:
transform in class SshCipher
Throws:
IOException

getProvider

public String getProvider()

init

public void init(int mode,
                 byte[] iv,
                 byte[] keydata)
          throws IOException
Specified by:
init in class SshCipher
Throws:
IOException

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in class SshCipher


Copyright © 2012. All Rights Reserved.