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,
SecurityLevel securityLevel) |
| Modifier and Type | Method and Description |
|---|---|
protected Cipher |
createCipher(String spec) |
protected AlgorithmParameterSpec |
generateAlgorithmSpec(byte[] iv) |
protected SecretKeySpec |
generateSecretKeySpec(byte[] actualKey) |
int |
getBlockSize()
Get the cipher block size.
|
int |
getKeyLength()
Return the key length required
|
String |
getProvider() |
String |
getProviderName() |
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, getMacLength, getPriority, getSecurityLevel, isMAC, transformpublic AbstractJCECipher(String spec, String keyspec, int keylength, String algorithm, SecurityLevel securityLevel) 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 keyIOExceptionpublic String getProviderName()
getProviderName in class SshCipherprotected Cipher createCipher(String spec) throws NoSuchAlgorithmException, NoSuchPaddingException
public void transform(byte[] buf,
int start,
byte[] output,
int off,
int len)
throws IOException
SshCiphertransform in class SshCipherIOExceptionpublic String getProvider()
public int getKeyLength()
SshCiphergetKeyLength in class SshCipherpublic void init(int mode,
byte[] iv,
byte[] keydata)
throws IOException
SshCipherinit in class SshCiphermode - the mode to operateiv - the initiaization vectorkeydata - the key dataIOExceptionprotected AlgorithmParameterSpec generateAlgorithmSpec(byte[] iv)
protected SecretKeySpec generateSecretKeySpec(byte[] actualKey)
public int getBlockSize()
SshCiphergetBlockSize in class SshCipherCopyright © 2025. All rights reserved.