|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--javax.crypto.spec.DESKeySpec
DES key specification.
Attention: This is not a SUN implementation!
This class has been developed by IAIK according to the documentation publicly
available.
For SUNīs documentation of this class see
http://java.sun.com/security/JCE1.2/spec/apidoc/index.html
This class represents a DES key specification.
A key specification is a transparent representation of the key material constituting the key. For a DES key, this class specifies the underlying byte material constituting the key.
KeySpec| Field Summary | |
static int |
DES_KEY_LEN
|
| Constructor Summary | |
DESKeySpec(byte[] key)
Creates a DES key specification by using the first 8 bytes of the supplied byte array as the DES key. |
|
DESKeySpec(byte[] key,
int offset)
Creates a DES key specification by using 8 bytes of the supplied byte array as DES key, beginning at the given offset. |
|
| Method Summary | |
byte[] |
getKey()
Returns the inherent DES key as byte representation. |
static boolean |
isParityAdjusted(byte[] key,
int offset)
Checks if the DES key, supplied in a byte array beginning at the given offset, is parity-adjusted. |
static boolean |
isWeak(byte[] key,
int offset)
Checks if the given DES key material, supplied within a byte array beginning at the given position, represents a weak or semi-weak DES key. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final int DES_KEY_LEN
| Constructor Detail |
public DESKeySpec(byte[] key)
throws InvalidKeyException
key - the byte array holding the DES key
public DESKeySpec(byte[] key,
int offset)
throws InvalidKeyException
key - the byte array holding the DES keyoffset - the offset indicating the start position within the input key byte array| Method Detail |
public byte[] getKey()
public static boolean isWeak(byte[] key,
int offset)
throws InvalidKeyException
key - the byte array holding the DES key to be checkedoffset - the offset indicating the start position within the given byte array from which
the key has to be readtrue if the given DES key material represents a weak or semi-weak
DES key, false if the represented key is a strong one.
public static boolean isParityAdjusted(byte[] key,
int offset)
throws InvalidKeyException
key - the byte array holding the DES keyoffset - the offset indicating the start position within the input key byte arraytrue if the given DES key is parity-adjusted, false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||