Package org.cryptacular.spec
Class AEADBlockCipherSpec
java.lang.Object
org.cryptacular.spec.AEADBlockCipherSpec
- All Implemented Interfaces:
Spec<org.bouncycastle.crypto.modes.AEADBlockCipher>
public class AEADBlockCipherSpec
extends Object
implements Spec<org.bouncycastle.crypto.modes.AEADBlockCipher>
Describes an AEAD block cipher in terms of a (algorithm, mode) tuple and provides a facility to create a new instance
of the cipher via the
newInstance()
method.- Version:
- $Revision: 2744 $
- Author:
- Middleware Services
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAEADBlockCipherSpec
(String algName, String cipherMode) Creates a new instance from a cipher algorithm and mode. -
Method Summary
Modifier and TypeMethodDescriptiongetMode()
Gets the cipher mode.org.bouncycastle.crypto.modes.AEADBlockCipher
Creates a new AEAD block cipher from the specification in this instance.static AEADBlockCipherSpec
Parses a string representation of a AEAD block cipher specification into an instance of this class.toString()
-
Field Details
-
FORMAT
String specification format,algorithm/mode
.
-
-
Constructor Details
-
AEADBlockCipherSpec
Creates a new instance from a cipher algorithm and mode.- Parameters:
algName
- Cipher algorithm name.cipherMode
- Cipher mode, e.g. GCM, CCM.
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceSpec<org.bouncycastle.crypto.modes.AEADBlockCipher>
- Returns:
- Cryptographic algorithm name.
-
getMode
Gets the cipher mode.- Returns:
- Cipher mode, e.g. CBC, OFB.
-
newInstance
public org.bouncycastle.crypto.modes.AEADBlockCipher newInstance()Creates a new AEAD block cipher from the specification in this instance.- Specified by:
newInstance
in interfaceSpec<org.bouncycastle.crypto.modes.AEADBlockCipher>
- Returns:
- New AEAD block cipher instance.
-
toString
-
parse
Parses a string representation of a AEAD block cipher specification into an instance of this class.- Parameters:
specification
- AEAD block cipher specification of the formalgorithm/mode
.- Returns:
- Buffered block cipher specification instance.
-