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(java.lang.String spec,
java.lang.String keyspec,
int keylength,
java.lang.String algorithm,
SecurityLevel securityLevel,
int priority) |
| Modifier and Type | Method and Description |
|---|---|
protected javax.crypto.Cipher |
createCipher(java.lang.String spec) |
int |
getBlockSize()
Get the cipher block size.
|
int |
getKeyLength()
Return the key length required
|
java.lang.String |
getProvider() |
java.lang.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(java.lang.String spec,
java.lang.String keyspec,
int keylength,
java.lang.String algorithm,
SecurityLevel securityLevel,
int priority)
throws java.io.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 keyjava.io.IOExceptionpublic java.lang.String getProviderName()
getProviderName in class SshCipherprotected javax.crypto.Cipher createCipher(java.lang.String spec)
throws java.security.NoSuchAlgorithmException,
javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmExceptionjavax.crypto.NoSuchPaddingExceptionpublic void transform(byte[] buf,
int start,
byte[] output,
int off,
int len)
throws java.io.IOException
SshCipherpublic java.lang.String getProvider()
public int getKeyLength()
SshCiphergetKeyLength in class SshCipherpublic void init(int mode,
byte[] iv,
byte[] keydata)
throws java.io.IOException
SshCipherpublic int getBlockSize()
SshCiphergetBlockSize in class SshCipherCopyright © 2022. All rights reserved.