|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
DESKey
contains an 8/16/24 byte key for single/2 key triple DES/3 key triple DES
operations.
When the key data is set, the key is initialized and ready for use.
KeyBuilder
,
Signature
,
Cipher
,
KeyEncryption
Method Summary | |
byte |
getKey(byte[] keyData,
short kOff)
Returns the Key data in plain text. |
void |
setKey(byte[] keyData,
short kOff)
Sets the Key data. |
Methods inherited from interface javacard.security.Key |
clearKey, getSize, getType, isInitialized |
Method Detail |
public void setKey(byte[] keyData, short kOff) throws CryptoException
Key
data. The plaintext length of input key data is 8 bytes for DES,
16 bytes for 2 key triple DES and 24 bytes for 3 key triple DES.
The data format is big-endian and right-aligned (the least significant bit is the least significant
bit of last byte). Input key data is copied into the internal representation.
keyData
- byte array containing key initialization datakOff
- offset within keyData to start
CryptoException
- with the following reason code:CryptoException.ILLEGAL_VALUE
if the input key data length is inconsistent
with the implementation or if input data decryption is required and fails.
Note:
javacardx.crypto.KeyEncryption
interface and the Cipher
object specified via setKeyCipher()
is not null
, keyData
is decrypted using the Cipher
object.
public byte getKey(byte[] keyData, short kOff)
Key
data in plain text. The length of output key data is 8 bytes for DES,
16 bytes for 2 key triple DES and 24 bytes for 3 key triple DES.
The data format is big-endian and right-aligned (the least significant bit is the least significant
bit of last byte).
keyData
- byte array to return key datakOff
- offset within keyData
to start.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |