public static final Cipher getInstance (String transformation, Provider provider) throws NoSuchAlgorithmException, NoSuchPaddingException

Returns a Cipher object that implements the specified transformation.

A new Cipher object encapsulating the CipherSpi implementation from the specified Provider object is returned. Note that the specified Provider object does not have to be registered in the provider list.

Parameters:
transformation    the name of the transformation, e.g., DES/CBC/PKCS5Padding. See the Cipher section in the Java Cryptography Architecture Standard Algorithm Name Documentation for information about standard transformation names.
provider    the provider.

Returns:  a cipher that implements the requested transformation.

Exceptions:
NoSuchAlgorithmException    if transformation is null, empty, in an invalid format, or if a CipherSpi implementation for the specified algorithm is not available from the specified Provider object.
NoSuchPaddingException    if transformation contains a padding scheme that is not available.
IllegalArgumentException    if the provider is null.

See also:
java.security.Provider