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.
DECRYPT_MODE, ENCRYPT_MODE
Constructor and Description |
---|
AbstractJCECipher(String spec,
String keyspec,
int keylength,
String algorithm) |
Modifier and Type | Method and Description |
---|---|
int |
getBlockSize()
Get the cipher block size.
|
String |
getProvider() |
void |
init(int mode,
byte[] iv,
byte[] keydata)
Initialize the cipher with up to 40 bytes of iv and key data.
|
void |
transform(byte[] buf,
int start,
byte[] output,
int off,
int len)
Transform the byte array according to the cipher mode; it is legal for
the source and destination arrays to reference the same physical array so
care should be taken in the transformation process to safeguard this
rule.
|
getAlgorithm, transform
public AbstractJCECipher(String spec, String keyspec, int keylength, String algorithm) throws IOException
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 keyIOException
public void transform(byte[] buf, int start, byte[] output, int off, int len) throws IOException
SshCipher
transform
in class SshCipher
IOException
public String getProvider()
public void init(int mode, byte[] iv, byte[] keydata) throws IOException
SshCipher
init
in class SshCipher
mode
- the mode to operateiv
- the initiaization vectorkeydata
- the key dataIOException
public int getBlockSize()
SshCipher
getBlockSize
in class SshCipher
Copyright © 2014. All rights reserved.