javax.crypto.spec
Class DESedeKeySpec

java.lang.Object
  |
  +--javax.crypto.spec.DESedeKeySpec
All Implemented Interfaces:
KeySpec

public class DESedeKeySpec
extends Object
implements KeySpec

DES-EDE key specification.


Attention:  This is not a SUN implementation!

This class has been developed by IAIK according to the documentation publically 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-EDE (TRIPLE DES) key specification. A key specification is a transparent representation of the key material constituting the key.

Version:
File Revision 14
See Also:
KeySpec

Field Summary
static int DES_EDE_KEY_LEN
           
 
Constructor Summary
DESedeKeySpec(byte[] key)
          Creates a DES-EDE key specification by using the first 24 bytes of the supplied byte array as the DES-EDE key.
DESedeKeySpec(byte[] key, int offset)
          Creates a DES-EDE key specification by using 24 bytes of the supplied byte array as DES-EDE key, beginning at the given offset.
 
Method Summary
 byte[] getKey()
          Returns the inherent DES-EDE key as byte representation.
static boolean isParityAdjusted(byte[] key, int offset)
          Checks if the DES-EDE key, supplied in a byte array beginning at the given offset, is parity-adjusted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DES_EDE_KEY_LEN

public static final int DES_EDE_KEY_LEN
Constructor Detail

DESedeKeySpec

public DESedeKeySpec(byte[] key)
              throws InvalidKeyException
Creates a DES-EDE key specification by using the first 24 bytes of the supplied byte array as the DES-EDE key.
Parameters:
key - the byte array holding the DES-EDE key
Throws:
InvalidKeyException - if the given key is shorter than 24 bytes

DESedeKeySpec

public DESedeKeySpec(byte[] key,
                     int offset)
              throws InvalidKeyException
Creates a DES-EDE key specification by using 24 bytes of the supplied byte array as DES-EDE key, beginning at the given offset.
Parameters:
key - the byte array holding the DES-EDE key
offset - the offset indicating the start position within the input key byte array
Throws:
InvalidKeyException - if the given key, beginning at offset, is shorter than 24 bytes
Method Detail

getKey

public byte[] getKey()
Returns the inherent DES-EDE key as byte representation.
Returns:
the DES-EDE key

isParityAdjusted

public static boolean isParityAdjusted(byte[] key,
                                       int offset)
                                throws InvalidKeyException
Checks if the DES-EDE key, supplied in a byte array beginning at the given offset, is parity-adjusted.
Parameters:
key - the byte array holding the DES-EDE key
offset - the offset indicating the start position within the input key byte array
Returns:
true if the given DES-EDE key is parity-adjusted, false otherwise
Throws:
InvalidKeyException - if the given key material, beginning at offset, is shorter than 24 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).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK