|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.AbstractAlgorithm
edu.vt.middleware.crypt.AbstractEncryptionAlgorithm
edu.vt.middleware.crypt.asymmetric.AsymmetricAlgorithm
public class AsymmetricAlgorithm
Provides asymmetric encryption and decryption operations using a public/private key pair.
| Field Summary | |
|---|---|
static String |
MODE
Mode used for encryption and decryption. |
static String |
PADDING
Padding used for encryption and decryption. |
| Fields inherited from class edu.vt.middleware.crypt.AbstractEncryptionAlgorithm |
|---|
cipher, cipherMode, key, mode, padding |
| Fields inherited from class edu.vt.middleware.crypt.AbstractAlgorithm |
|---|
algorithm, logger, randomByteSize, randomProvider |
| Constructor Summary | |
|---|---|
protected |
AsymmetricAlgorithm(String cipherAlgorithm)
Creates a new instance that uses a cipher of the given algorithm and the default mode and padding. |
| Method Summary | |
|---|---|
KeyPair |
generateKeys()
Generates a public/private key pair of the default length suitable for the cipher used for encryption on this instance. |
KeyPair |
generateKeys(int bitLength)
Generates a public/private key pair of the given length suitable for the cipher used for encryption on this instance. |
static KeyPair |
generateKeys(String algorithm,
int bitLength,
SecureRandom random)
Generates a public/private key pair using the given cipher algorithm. |
protected AlgorithmParameterSpec |
getAlgorithmParameterSpec()
Gets the algorithm parameter specification for this algorithm. |
protected int |
getChunkSize()
Gets the chunk size for buffers using in stream-based encryption and decryption operations. |
int |
getDefaultKeyLength()
Gets the default key length for this algorithm. |
static AsymmetricAlgorithm |
newInstance(String algorithm)
Creates a new instance that uses a cipher of the given name. |
| Methods inherited from class edu.vt.middleware.crypt.AbstractEncryptionAlgorithm |
|---|
crypt, crypt, decrypt, decrypt, decrypt, encrypt, encrypt, encrypt, getBlockSize, getCipherMode, getMode, getPadding, init, initCipher, initDecrypt, initEncrypt, setKey, toString |
| Methods inherited from class edu.vt.middleware.crypt.AbstractAlgorithm |
|---|
getAlgorithm, getRandomData, setRandomProvider |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.vt.middleware.crypt.Algorithm |
|---|
getAlgorithm, getRandomData, setRandomProvider |
| Field Detail |
|---|
public static final String MODE
public static final String PADDING
| Constructor Detail |
|---|
protected AsymmetricAlgorithm(String cipherAlgorithm)
cipherAlgorithm - Cipher algorithm name.| Method Detail |
|---|
public static AsymmetricAlgorithm newInstance(String algorithm)
algorithm - Cipher algorithm name.
public static KeyPair generateKeys(String algorithm,
int bitLength,
SecureRandom random)
throws CryptException
algorithm - Name of a cipher algorithm for which a suitable key pair
will be generated.bitLength - Size of each key in pair in bits.random - Source of randomness used for key generation.
CryptException - On key pair generation errors.
public KeyPair generateKeys()
throws CryptException
CryptException - On key pair generation errors.
public KeyPair generateKeys(int bitLength)
throws CryptException
bitLength - Size of each key in pair in bits.
CryptException - On key pair generation errors.public int getDefaultKeyLength()
protected AlgorithmParameterSpec getAlgorithmParameterSpec()
getAlgorithmParameterSpec in class AbstractEncryptionAlgorithmprotected int getChunkSize()
getChunkSize in class AbstractEncryptionAlgorithm
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||