Lines Matching refs:key

38      * SecretKeySpec(byte[] key, String algorithm) method testing. Tests that
44 byte[] key = new byte[] {1, 2, 3, 4, 5};
50 + "in the case of empty key.");
57 + "in the case of null key.");
62 new SecretKeySpec(key, null);
68 SecretKeySpec ks = new SecretKeySpec(key, algorithm);
69 key[0] ++;
70 assertFalse("The change of key specified in the constructor "
72 key[0] == ks.getEncoded()[0]);
76 * SecretKeySpec(byte[] key, int offset, int len, String algorithm) method
82 byte[] key = new byte[] {1, 2, 3, 4, 5};
90 + "in the case of empty key.");
97 + "in the case of null key.");
102 new SecretKeySpec(key, offset, len, null);
104 + "in the case of short key algorithm.");
109 new SecretKeySpec(key, offset, key.length, algorithm);
111 + "in the case of null key.");
116 new SecretKeySpec(key, 0, -1, algorithm);
124 SecretKeySpec ks = new SecretKeySpec(key, algorithm);
125 key[offset] ++;
126 assertFalse("The change of key specified in the constructor "
128 key[offset] == ks.getEncoded()[0]);
140 byte[] key = new byte[] {1, 2, 3, 4, 5};
146 new SecretKeySpec(key, -1, key.length, algorithm);
160 byte[] key = new byte[] {1, 2, 3, 4, 5};
163 SecretKeySpec ks = new SecretKeySpec(key, algorithm);
173 byte[] key = new byte[] {1, 2, 3, 4, 5};
176 SecretKeySpec ks = new SecretKeySpec(key, algorithm);
187 byte[] key = new byte[] {1, 2, 3, 4, 5};
190 SecretKeySpec ks = new SecretKeySpec(key, algorithm);
192 if (! Arrays.equals(key, result)) {
193 fail("The returned key does not equal to the specified "
197 assertFalse("The change of returned by getEncoded() method key "
204 SecretKeySpec sks = new SecretKeySpec(key, offset, len, algorithm);
213 byte[] key = new byte[] {1, 2, 3, 4, 5};
216 SecretKeySpec ks1 = new SecretKeySpec(key, algorithm);
217 SecretKeySpec ks2 = new SecretKeySpec(key, algorithm);
228 byte[] key = new byte[] {1, 2, 3, 4, 5};
231 SecretKeySpec ks1 = new SecretKeySpec(key, algorithm);
232 SecretKeySpec ks2 = new SecretKeySpec(key, algorithm);
233 SecretKeySpec ks3 = new SecretKeySpec(key, algorithm);
257 ks2 = new SecretKeySpec(key, "Another Algorithm");