Class Overview
The key specification for a DES key.
Summary
Constants |
int |
DES_KEY_LEN |
The length of a DES key in bytes. |
Public Constructors |
|
DESKeySpec(byte[] key)
Creates a new DESKeySpec from the first 8 bytes of the
specified key data.
|
|
DESKeySpec(byte[] key, int offset)
Creates a new DESKeySpec from the first 8 bytes of the
specified key data starting at offset .
|
Public Methods |
byte[]
|
getKey()
Returns a copy of the key.
|
static
boolean
|
isParityAdjusted(byte[] key, int offset)
Returns whether the specified key data starting at offset is
parity-adjusted.
|
static
boolean
|
isWeak(byte[] key, int offset)
Returns whether the specified key data starting at offset is
weak or semi-weak.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Constants
public
static
final
int
DES_KEY_LEN
The length of a DES key in bytes.
Constant Value:
8
(0x00000008)
Public Constructors
public
DESKeySpec
(byte[] key)
Creates a new DESKeySpec
from the first 8 bytes of the
specified key data.
public
DESKeySpec
(byte[] key, int offset)
Creates a new DESKeySpec
from the first 8 bytes of the
specified key data starting at offset
.
Parameters
key
| the key data |
offset
| the offset to start at. |
Public Methods
public
byte[]
getKey
()
Returns a copy of the key.
public
static
boolean
isParityAdjusted
(byte[] key, int offset)
Returns whether the specified key data starting at offset
is
parity-adjusted.
Parameters
key
| the key data. |
offset
| the offset to start checking at. |
Returns
true
if the specified key data is parity-adjusted,
false
otherwise.
Throws
InvalidKeyException
| if the length of the key data starting at offset is less than
8, or the key is null.
|
public
static
boolean
isWeak
(byte[] key, int offset)
Returns whether the specified key data starting at offset
is
weak or semi-weak.
Parameters
key
| the key data. |
offset
| the offset to start checking at. |
Returns
true
if the specified key data is weak or semi-weak.
Throws
InvalidKeyException
| if the length of the key data starting at offset is less than
8, or it is null.
|