public DESedeKeySpec(byte[] key,
int offset) throws InvalidKeyException {
if (key.length - offset < 24) {
throw new InvalidKeyException("Wrong key size");
}
this.key = new byte[24];
System.arraycopy(key, offset, this.key, 0, 24);
}
Creates a DESedeKeySpec object using the first 24 bytes in
key, beginning at offset inclusive,
as the key material for the DES-EDE key.
The bytes that constitute the DES-EDE key are those between
key[offset] and key[offset+23] inclusive. Parameters:
key - the buffer with the DES-EDE key material. The first
24 bytes of the buffer beginning at offset inclusive
are copied to protect against subsequent modification.
offset - the offset in key, where the DES-EDE key
material starts.
Throws:
NullPointerException - if key is null.
InvalidKeyException - if the given key material, starting at
offset inclusive, is shorter than 24 bytes
- exception:
NullPointerException - if key is null.
- exception:
InvalidKeyException - if the given key material, starting at
offset inclusive, is shorter than 24 bytes
|