public abstract class LunaCipher extends CipherSpi
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LunaCipher.Padding
padding options
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
bytesCached |
protected int |
keySizeBytes |
protected static Logger |
LOGGER |
protected byte[] |
mAccumulator |
protected AlgorithmParameters |
mAlgParams |
protected int |
mBlockSize |
protected boolean |
mHsmOperationActive |
protected LunaKey |
mKey |
protected long |
mMechType |
protected int |
mOpMode |
protected LunaCipher.Padding |
mPadding |
protected boolean |
mStandardSpec |
protected static SecureRandom |
rand |
| Constructor and Description |
|---|
LunaCipher(long mechType,
String keyAlg,
String padding,
int blockSize,
boolean singlePart,
boolean standardSpec) |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
engineDoFinal(byte[] input,
int inputOffset,
int inputLen) |
protected int |
engineDoFinal(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset) |
protected int |
engineGetBlockSize() |
protected byte[] |
engineGetIV() |
protected int |
engineGetKeySize(Key key)
Returns the key size of the given key object in bits.
|
protected int |
engineGetOutputSize(int inputLen) |
protected AlgorithmParameters |
engineGetParameters() |
protected void |
engineInit(int opmode,
Key key,
SecureRandom random) |
protected void |
engineSetMode(String mode) |
protected void |
engineSetPadding(String padding) |
protected Key |
engineUnwrap(byte[] wrappedKey,
String wrappedKeyAlgorithm,
int wrappedKeyType)
Unwrap a previously wrapped key.
|
protected byte[] |
engineUpdate(byte[] input,
int inputOffset,
int inputLen) |
protected int |
engineUpdate(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset) |
protected byte[] |
engineWrap(Key key) |
protected void |
finalize() |
engineDoFinal, engineInit, engineInit, engineUpdate, engineUpdateAAD, engineUpdateAADprotected static final Logger LOGGER
protected long mMechType
protected int mBlockSize
protected final boolean mStandardSpec
protected AlgorithmParameters mAlgParams
protected int mOpMode
protected LunaKey mKey
protected int keySizeBytes
protected byte[] mAccumulator
protected LunaCipher.Padding mPadding
protected int bytesCached
protected boolean mHsmOperationActive
protected static final SecureRandom rand
protected void finalize()
throws Throwable
protected void engineSetMode(String mode) throws NoSuchAlgorithmException
engineSetMode in class CipherSpiNoSuchAlgorithmExceptionprotected void engineSetPadding(String padding) throws NoSuchPaddingException
engineSetPadding in class CipherSpiNoSuchPaddingExceptionprotected byte[] engineGetIV()
engineGetIV in class CipherSpiprotected int engineGetOutputSize(int inputLen)
engineGetOutputSize in class CipherSpiprotected int engineGetBlockSize()
engineGetBlockSize in class CipherSpiprotected AlgorithmParameters engineGetParameters()
engineGetParameters in class CipherSpiprotected void engineInit(int opmode,
Key key,
SecureRandom random)
throws InvalidKeyException
engineInit in class CipherSpiInvalidKeyExceptionprotected byte[] engineUpdate(byte[] input,
int inputOffset,
int inputLen)
engineUpdate in class CipherSpiprotected int engineUpdate(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset)
throws IllegalStateException,
ShortBufferException
engineUpdate in class CipherSpiIllegalStateExceptionShortBufferExceptionprotected byte[] engineDoFinal(byte[] input,
int inputOffset,
int inputLen)
throws IllegalBlockSizeException,
BadPaddingException
engineDoFinal in class CipherSpiIllegalBlockSizeExceptionBadPaddingExceptionprotected int engineDoFinal(byte[] input,
int inputOffset,
int inputLen,
byte[] output,
int outputOffset)
throws ShortBufferException,
IllegalBlockSizeException,
BadPaddingException
engineDoFinal in class CipherSpiShortBufferExceptionIllegalBlockSizeExceptionBadPaddingExceptionprotected int engineGetKeySize(Key key) throws InvalidKeyException
engineGetKeySize in class CipherSpikey - the key to size upInvalidKeyException - if the key type is not a Luna or
RAW secret key, or an RSA keyprotected Key engineUnwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException
engineUnwrap in class CipherSpiInvalidKeyException - if wrappedKey cannot be unwrapped properlyLunaException - if the algorithm parameters can't be used
for this unwrap operationprotected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException
engineWrap in class CipherSpiIllegalBlockSizeExceptionInvalidKeyExceptionCopyright 2014-2016 SafeNet Inc