Module org.refcodes.forwardsecrecy
Class AsymmetricAlgorithm
java.lang.Object
edu.vt.middleware.crypt.AbstractAlgorithm
edu.vt.middleware.crypt.AbstractEncryptionAlgorithm
edu.vt.middleware.crypt.asymmetric.AsymmetricAlgorithm
- All Implemented Interfaces:
Algorithm
,EncryptionAlgorithm
- Direct Known Subclasses:
RSA
Provides asymmetric encryption and decryption operations using a
public/private key pair.
- Version:
- $Revision: 2744 $
- Author:
- Middleware Services
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Mode used for encryption and decryption.static final String
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, randomByteSize, randomProvider
-
Constructor Summary
ModifierConstructorDescriptionprotected
AsymmetricAlgorithm
(String cipherAlgorithm) Creates a new instance that uses a cipher of the given algorithm and the default mode and padding. -
Method Summary
Modifier and TypeMethodDescriptionclone()
protected AlgorithmParameterSpec
Gets the algorithm parameter specification for this algorithm.protected int
Gets the chunk size for buffers using in stream-based encryption and decryption operations.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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.vt.middleware.crypt.Algorithm
getAlgorithm, getRandomData, setRandomProvider
-
Field Details
-
MODE
Mode used for encryption and decryption.- See Also:
-
PADDING
Padding used for encryption and decryption.- See Also:
-
-
Constructor Details
-
AsymmetricAlgorithm
Creates a new instance that uses a cipher of the given algorithm and the default mode and padding.- Parameters:
cipherAlgorithm
- Cipher algorithm name.
-
-
Method Details
-
newInstance
Creates a new instance that uses a cipher of the given name.- Parameters:
algorithm
- Cipher algorithm name.- Returns:
- Asymmetric algorithm instance that implements the given cipher algorithm.
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
getAlgorithmParameterSpec
Gets the algorithm parameter specification for this algorithm.- Specified by:
getAlgorithmParameterSpec
in classAbstractEncryptionAlgorithm
- Returns:
- Algorithm parameter specification specific to this algorithm.
-
getChunkSize
protected int getChunkSize()Gets the chunk size for buffers using in stream-based encryption and decryption operations.- Specified by:
getChunkSize
in classAbstractEncryptionAlgorithm
- Returns:
- Stream chunk size.
-