Home | History | Annotate | Download | only in spec

Lines Matching defs:key

31  * This class specifies a DES-EDE ("triple-DES") key.
40 * The constant which defines the length of a DESede key in bytes.
44 private byte[] key;
48 * <code>key</code> as the key material for the DES-EDE key.
50 * <p> The bytes that constitute the DES-EDE key are those between
51 * <code>key[0]</code> and <code>key[23]</code> inclusive
53 * @param key the buffer with the DES-EDE key material. The first
57 * @exception NullPointerException if <code>key</code> is null.
58 * @exception InvalidKeyException if the given key material is shorter
61 public DESedeKeySpec(byte[] key) throws InvalidKeyException {
62 this(key, 0);
67 * <code>key</code>, beginning at <code>offset</code> inclusive,
68 * as the key material for the DES-EDE key.
70 * <p> The bytes that constitute the DES-EDE key are those between
71 * <code>key[offset]</code> and <code>key[offset+23]</code> inclusive.
73 * @param key the buffer with the DES-EDE key material. The first
76 * @param offset the offset in <code>key</code>, where the DES-EDE key
79 * @exception NullPointerException if <code>key</code> is null.
80 * @exception InvalidKeyException if the given key material, starting at
83 public DESedeKeySpec(byte[] key, int offset) throws InvalidKeyException {
84 if (key.length - offset < 24) {
85 throw new InvalidKeyException("Wrong key size");
87 this.key = new byte[24];
88 System.arraycopy(key, offset, this.key, 0, 24);
92 * Returns the DES-EDE key.
94 * @return the DES-EDE key. Returns a new array
98 return this.key.clone();
102 * Checks if the given DES-EDE key, starting at <code>offset</code>
105 * @param key a byte array which holds the key value
107 * @return true if the given DES-EDE key is parity-adjusted, false
110 * @exception NullPointerException if <code>key</code> is null.
111 * @exception InvalidKeyException if the given key material, starting at
114 public static boolean isParityAdjusted(byte[] key, int offset)
116 if (key.length - offset < 24) {
117 throw new InvalidKeyException("Wrong key size");
119 if (DESKeySpec.isParityAdjusted(key, offset) == false
120 || DESKeySpec.isParityAdjusted(key, offset + 8) == false
121 || DESKeySpec.isParityAdjusted(key, offset + 16) == false) {