|
|||||||||
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 keyInvalidKeyException
- if the given key is shorter than 8 bytespublic 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 arrayInvalidKeyException
- if the given key, beginning at offset, is shorter than 8 bytesMethod 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.InvalidKeyException
- if the given key, beginning at offset, is shorter than 8 bytespublic 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
otherwiseInvalidKeyException
- if the given key, beginning at offset, is shorter than 8 bytes
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |