|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.licel.jcardsim.crypto.KeyImpl com.licel.jcardsim.crypto.SymmetricKeyImpl
Implementation of secret key
Field Summary | |
---|---|
protected ByteContainer |
key
|
Fields inherited from class com.licel.jcardsim.crypto.KeyImpl |
---|
size, type |
Constructor Summary | |
---|---|
SymmetricKeyImpl(byte keyType,
short keySize)
Create new instance of SymmetricKeyImpl |
Method Summary | |
---|---|
void |
clearKey()
Clears the key and sets its initialized state to false. |
org.bouncycastle.crypto.BlockCipher |
getCipher()
Return the BouncyCastle BlockCipher for using with this key |
byte |
getKey(byte[] keyData,
short kOff)
Returns the Key data in plain text. |
org.bouncycastle.crypto.KeyGenerationParameters |
getKeyGenerationParameters(SecureRandom rnd)
Get keypair generation parameters for use with BouncyCastle Crypto API |
org.bouncycastle.crypto.CipherParameters |
getParameters()
Return the BouncyCastle KeyParameter of the key |
boolean |
isInitialized()
Reports the initialized state of the key. |
void |
setKey(byte[] keyData,
short kOff)
Sets the Key data. |
Methods inherited from class com.licel.jcardsim.crypto.KeyImpl |
---|
getSize, getType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javacard.security.Key |
---|
getSize, getType |
Field Detail |
---|
protected ByteContainer key
Constructor Detail |
---|
public SymmetricKeyImpl(byte keyType, short keySize)
SymmetricKeyImpl
keyType
- keyType interfacekeySize
- keySize in bitsKeyBuilder
Method Detail |
---|
public void clearKey()
public void setKey(byte[] keyData, short kOff) throws CryptoException, NullPointerException, ArrayIndexOutOfBoundsException
Key
data.
keyData
- byte array containing key initialization datakOff
- offset within keyData to start
CryptoException
- with the following reason code:
CryptoException.ILLEGAL_VALUE
if input data decryption is required and fails.
NullPointerException
- - if the keyData
parameter is null
ArrayIndexOutOfBoundsException
- if kOff
is negative
or the keyData
array is too shortpublic byte getKey(byte[] keyData, short kOff)
Key
data in plain text.
keyData
- byte array to return key datakOff
- offset within keyData
to start
Key
public org.bouncycastle.crypto.CipherParameters getParameters() throws CryptoException
KeyParameter
of the key
getParameters
in interface KeyWithParameters
CryptoException
- if key not initializedKeyParameter
public org.bouncycastle.crypto.BlockCipher getCipher() throws CryptoException
BlockCipher
for using with this key
BlockCipher
for this key
CryptoException
- if key not initializedBlockCipher
public boolean isInitialized()
Key
A Key
object sets its initialized state to true only when all the associated
Key
object parameters have been set at least once since the time the initialized state was set to false.
A newly created Key
object sets its initialized state to false. Invocation of the
clearKey()
method sets the initialized state to false. A key with transient key data
sets its initialized state to false on the associated clear events.
isInitialized
in interface Key
true
if the key has been initializedpublic org.bouncycastle.crypto.KeyGenerationParameters getKeyGenerationParameters(SecureRandom rnd)
KeyWithParameters
getKeyGenerationParameters
in interface KeyWithParameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |