Package javax.crypto.spec
Class DESedeKeySpec
- java.lang.Object
-
- javax.crypto.spec.DESedeKeySpec
-
-
Field Summary
Fields Modifier and Type Field Description static intDES_EDE_KEY_LENThe length of a DES-EDE key in bytes.
-
Constructor Summary
Constructors Constructor Description DESedeKeySpec(byte[] key)Creates a newDESedeKeySpecinstance from the first 24 (DES_EDE_KEY_LEN) bytes of the specified key data.DESedeKeySpec(byte[] key, int offset)Creates a newDESedeKeySpecinstance from the first 24 (DES_EDE_KEY_LEN) bytes of the specified key data starting atoffset.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getKey()Returns a copy of the key.static booleanisParityAdjusted(byte[] key, int offset)Returns whether the specified key data starting atoffsetis parity-adjusted.
-
-
-
Field Detail
-
DES_EDE_KEY_LEN
public static final int DES_EDE_KEY_LEN
The length of a DES-EDE key in bytes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DESedeKeySpec
public DESedeKeySpec(byte[] key) throws InvalidKeyExceptionCreates a newDESedeKeySpecinstance from the first 24 (DES_EDE_KEY_LEN) bytes of the specified key data.- Parameters:
key- the key data.- Throws:
InvalidKeyException- if the length of the key data is less than 24.NullPointerException- if the key data is null.
-
DESedeKeySpec
public DESedeKeySpec(byte[] key, int offset) throws InvalidKeyExceptionCreates a newDESedeKeySpecinstance from the first 24 (DES_EDE_KEY_LEN) bytes of the specified key data starting atoffset.- Parameters:
key- the key dataoffset- the offset to start at.- Throws:
InvalidKeyException- if the length of the key data starting at offset is less than 24.NullPointerException- if the key data is null.
-
-
Method Detail
-
getKey
public byte[] getKey()
Returns a copy of the key.- Returns:
- a copy of the key.
-
isParityAdjusted
public static boolean isParityAdjusted(byte[] key, int offset) throws InvalidKeyExceptionReturns whether the specified key data starting atoffsetis parity-adjusted.- Parameters:
key- the key data.offset- the offset to start checking at.- Returns:
trueif the specified key data is parity-adjusted,falseotherwise.- Throws:
InvalidKeyException- if the length of the key data starting at offset is less than 24.
-
-