|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.security.des.DesKey
DES key.
Details: A DesKey defines a 64-bit DES key, 56-bits of which are used to select a DES encryption function.
bit ordering
Refer to the package summary for important information regarding bit ordering.
DesEngine
,
TripleDesKey
Constructor Summary | |
DesKey(byte[] bytes,
int offset)
Specifies key as a byte sequence. |
|
DesKey(int[] halves,
int offset)
Specifies 32-bit left and right halves. |
|
DesKey(int lh,
int rh)
Sets key halves. |
|
DesKey(long key)
Sets key. |
Method Summary | |
boolean |
hasOddParity()
Tests for odd parity. |
long |
longValue()
Converts this key to long value. |
java.lang.String |
toString()
Converts this key to a String. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public DesKey(int lh, int rh)
Details: This constructor initializes the key using the 32-bit left and right halves provided. The MSB of lh corresponds to bit 1 of the key described in FIPS PUB 46, while the LSB of rh corresponds to bit 64.
lh
- the left halfrh
- the right halfpublic DesKey(long key)
Details: This constructor initializes the key using the given 64-bit value. The MSB corresponds to bit 1 of the key described in FIPS PUB 46.
key
- the keypublic DesKey(int[] halves, int offset)
Details: This constructor initializes the key using the 32-bit left and right halves provided. The left half is index by offset and the right half is index by offset + 1.
halves
- the left and right halvesoffset
- index of left halfpublic DesKey(byte[] bytes, int offset)
Details: This constructor initializes the key using the given 8 bytes. The bytes are ordered in big endian order, and the first byte is indexed by offset, and the MSB of the first byte corresponds to bit 1 of the key described in FIPS PUB 46.
bytes
- the byte arrayoffset
- index of first byteMethod Detail |
public boolean hasOddParity()
Details: This method determines whether this DES key has odd parity. A DES key is said to have odd parity when each octet (byte) of the key has odd parity (i.e., total number of set bits is odd).
A correctly specified DES key should have odd parity.
public long longValue()
Details: This method returns this key as a long
value.
public java.lang.String toString()
Details: This method returns this key as a 16 character hexadecimal String
.
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |