public class Rc2Cipher extends BlockCipher
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CIPHER_NAME
The JCE name of this cipher.
|
protected static java.util.Hashtable |
cipherModePaddingMechansims_
The mapping from mode + "/" + padding to the cryptoki mechanism for RC2.
|
protected static iaik.pkcs.pkcs11.Mechanism |
DEFAULT_MECHANISM
The defualt mechanism for this cipher.
|
protected javax.crypto.spec.RC2ParameterSpec |
rc2ParameterSpec_
The current RC2 cipher parameter.
|
protected boolean |
rc2ParameterSpecChanged_
Indicates that the rc2ParameterSpec_ has been changed.
|
DEFAULT_MODE, DEFAULT_PADDING, externalPadding_, externalPaddings_, ivParameterSpec_, ivParameterSpecChanged_, modePaddingMechanisms_, supportedModes_, supportedPaddings_
currentKeyIsSoftwareKey_, DUMMY_DATA, initialized_, key_, keyObject_, mechanism_, mode_, modeChanged_, operationMode_, padding_, paddingChanged_, parameters_, parameterSpecs_, pkcs11OperationInitialized_, session_, softwareDelegate_, tokenManager_, unwrapTemplate_, updateUsed_, usedMechanismInfos_, usedMechanisms_
Constructor and Description |
---|
Rc2Cipher()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkKeyObject(iaik.pkcs.pkcs11.objects.Key keyObject)
Check the given key object, if it is acceptable for this cipher.
|
protected java.lang.String |
getAlgorithmName()
Get the JCE name of this cipher algorithm.
|
protected iaik.pkcs.pkcs11.Mechanism |
getDefaultMechanism()
Get the default mechanism of this cipher.
|
protected iaik.pkcs.pkcs11.Mechanism |
getMechanism()
Get the current mechanism of this cipher object.
|
protected java.util.Hashtable |
getModePaddingMechanisms()
Get the hashtable that maps from mode + "/" + padding to the cryptoki mechanism.
|
protected iaik.pkcs.pkcs11.Mechanism[] |
getUsedMechanisms()
Returns an array of Mechanisms that this engine class uses.
|
protected int |
pkcs11GetBlockSize()
Get the block size of this cipher algorithm.
|
protected int |
pkcs11GetKeySize(java.security.Key key)
Determines the key size in bits.
|
protected int |
pkcs11GetOutputSize(int inputLen)
Returns the length in bytes that an output buffer would need to be in order to hold the result
of the next update or doFinal operation, given the input length inputLen (in bytes).
|
protected void |
pkcs11Init(int operationMode,
java.security.Key key,
java.security.spec.AlgorithmParameterSpec parameterSpecs,
java.security.SecureRandom randomSource)
Initialize this cipher for an operation.
|
getDefaultMode, getDefaultPadding, getMechanismForModeAndPadding, getUsedMechanismFeatures, isExternalPaddingSupported, isModeSupported, isPaddingSupported, pkcs11DoFinal, pkcs11GetIV, pkcs11GetParameters, pkcs11Init, pkcs11Update
engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetKeySize, engineGetOutputSize, engineGetParameters, engineInit, engineInit, engineInit, engineSetMode, engineSetPadding, engineUnwrap, engineUpdate, engineUpdate, engineUpdateAAD, engineWrap, finalize, finalizePkcs11Operation, getFullAlgorithmName, initialize, initializePkcs11Operation, initializeSession, initializeSoftwareDelegate, isSupportedBy, pkcs11DoFinal, pkcs11Init, pkcs11Unwrap, pkcs11Update, pkcs11Wrap, updateAAD, updateAAD, updateAAD
protected static final java.lang.String CIPHER_NAME
protected static final iaik.pkcs.pkcs11.Mechanism DEFAULT_MECHANISM
protected static java.util.Hashtable cipherModePaddingMechansims_
protected javax.crypto.spec.RC2ParameterSpec rc2ParameterSpec_
protected boolean rc2ParameterSpecChanged_
protected iaik.pkcs.pkcs11.Mechanism[] getUsedMechanisms()
getRequiredMechanismFeatures()
method.getUsedMechanisms
in class PKCS11Cipher
getUsedMechanismFeatures()
. May be empty, but must not be null.protected void checkKeyObject(iaik.pkcs.pkcs11.objects.Key keyObject) throws java.security.InvalidKeyException
checkKeyObject
in class BlockCipher
keyObject
- The key object to check.java.security.InvalidKeyException
- If this cipher cannot work with this type of key object.protected java.lang.String getAlgorithmName()
getAlgorithmName
in class PKCS11Cipher
protected java.util.Hashtable getModePaddingMechanisms()
getModePaddingMechanisms
in class BlockCipher
protected iaik.pkcs.pkcs11.Mechanism getDefaultMechanism()
getDefaultMechanism
in class BlockCipher
protected iaik.pkcs.pkcs11.Mechanism getMechanism()
getMechanism
in class BlockCipher
protected int pkcs11GetOutputSize(int inputLen)
pkcs11GetOutputSize
in class PKCS11Cipher
inputLen
- The length of the input data in bytes.protected int pkcs11GetKeySize(java.security.Key key) throws java.security.InvalidKeyException
pkcs11GetKeySize
in class BlockCipher
key
- The key to get the length for.java.security.InvalidKeyException
- If the given key is not supported by this class.protected int pkcs11GetBlockSize()
pkcs11GetBlockSize
in class BlockCipher
protected void pkcs11Init(int operationMode, java.security.Key key, java.security.spec.AlgorithmParameterSpec parameterSpecs, java.security.SecureRandom randomSource) throws java.security.InvalidAlgorithmParameterException, java.security.InvalidKeyException
pkcs11Init
in class BlockCipher
operationMode
- The operation to initialize; Cipher.ENCRYPT_MODE, Cipher.DECRYPT_MODE,
Cipher.UNWRAP_MODE or Cipher.WRAP_MODE.key
- The key to use for the operation.parameterSpecs
- The parameter specs to use. Some cipher do not support parameter specs, they require
null.randomSource
- Optional random source to use.java.security.InvalidAlgorithmParameterException
- If the parameter specs are invalid.java.security.InvalidKeyException
- If the key is invalid for this operation.IAIK JavaSecurity Website https://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2023 IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved. Version 1.9.4