Lines Matching refs:key

155      * Initializes this cipher with a key and a source of randomness.
158 * encryption, decryption, key wrapping or key unwrapping, depending on
163 * This behaviour should only be used in encryption or key wrapping
166 * key unwrapping, the IV
167 * (same IV that was used for encryption or key wrapping) must be provided
178 * @param key the secret key
181 * @exception InvalidKeyException if the given key is inappropriate for
184 protected void engineInit(int opmode, Key key, SecureRandom random)
186 core.init(opmode, key, random);
190 * Initializes this cipher with a key, a set of
194 * encryption, decryption, key wrapping or key unwrapping, depending on
204 * @param key the encryption key
208 * @exception InvalidKeyException if the given key is inappropriate for
213 protected void engineInit(int opmode, Key key,
217 core.init(opmode, key, params, random);
220 protected void engineInit(int opmode, Key key,
224 core.init(opmode, key, params, random);
362 * Returns the key size of the given key object.
364 * @param key the key object.
366 * @return the key size of the given key object.
368 * @exception InvalidKeyException if <code>key</code> is invalid.
370 protected int engineGetKeySize(Key key) throws InvalidKeyException {
371 byte[] encoded = key.getEncoded();
373 throw new InvalidKeyException("Invalid key length: " +
380 * Wrap a key.
382 * @param key the key to be wrapped.
384 * @return the wrapped key.
388 * encoding of the key to be wrapped is not a
392 * wrap the key with this cipher (e.g., a hardware protected key is
395 protected byte[] engineWrap(Key key)
397 return core.wrap(key);
401 * Unwrap a previously wrapped key.
403 * @param wrappedKey the key to be unwrapped.
405 * @param wrappedKeyAlgorithm the algorithm the wrapped key is for.
407 * @param wrappedKeyType the type of the wrapped key.
411 * @return the unwrapped key.
418 * represent a wrapped key of type <code>wrappedKeyType</code> for