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

Returns a Cipher object that implements the specified transformation.

A new Cipher object encapsulating the CipherSpi implementation from the specified provider is returned. The specified provider must be registered in the security provider list.

Note that the list of registered providers may be retrieved via the Security.getProviders() method.

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 name of 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.
NoSuchProviderException    if the specified provider is not registered in the security provider list.
NoSuchPaddingException    if transformation contains a padding scheme that is not available.
IllegalArgumentException    if the provider is null or empty.

See also:
java.security.Provider