public static final ExemptionMechanism getInstance(String algorithm,
            String provider) throws NoSuchAlgorithmException,
            NoSuchProviderException {
        Instance instance = JceSecurity.getInstance("ExemptionMechanism",
                ExemptionMechanismSpi.class, algorithm, provider);
        return new ExemptionMechanism((ExemptionMechanismSpi)instance.impl,
                instance.provider, algorithm);
    }
public static final ExemptionMechanism getInstance ( String algorithm , String provider ) throws NoSuchAlgorithmException , NoSuchProviderException { Instance instance = JceSecurity . getInstance ( "ExemptionMechanism" , ExemptionMechanismSpi . class , algorithm , provider ) ; return new ExemptionMechanism ( ( ExemptionMechanismSpi ) instance . impl , instance . provider , algorithm ) ; }
Returns an <code>ExemptionMechanism</code> object that implements the
specified exemption mechanism algorithm.

<p> A new ExemptionMechanism object encapsulating the
ExemptionMechanismSpi implementation from the specified provider
is returned.  The specified provider must be registered
in the security provider list.

<p> Note that the list of registered providers may be retrieved via
the {@link Security#getProviders() Security.getProviders()} method.

@param algorithm the standard name of the requested exemption mechanism.
See the ExemptionMechanism section in the
<a href=
"{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Exemption">
Java Cryptography Architecture Standard Algorithm Name Documentation</a>
for information about standard exemption mechanism names.

@param provider the name of the provider.

@return the new <code>ExemptionMechanism</code> object.

@exception NullPointerException if <code>algorithm</code>
is null.

@exception NoSuchAlgorithmException if an ExemptionMechanismSpi
implementation for the specified algorithm is not
available from the specified provider.

@exception NoSuchProviderException if the specified provider is not
registered in the security provider list.

@exception IllegalArgumentException if the <code>provider</code>
is null or empty.

@see java.security.Provider