Code example for NoSuchProviderException

    if (provider == null)
      throw new IllegalArgumentException("provider MUST NOT be null");
    Provider p = Security.getProvider(provider);
    if (p == null)
      throw new NoSuchProviderException(provider);
    return getInstance(type, p);
   * Create an instance of <code>CallbackHandler</code> of the designated 
   * <code>type</code> from the designated security <code>provider</code>. 
   * @param type the type of callback handler to create. 
   * @param provider a security provider to use. 
   * @return a newly created instance of <code>ClassbackHandler</code>. 
   * @throws NoSuchAlgorithmException if no security provider is found to offer 
   *           an implementation of <code>CallbackHandler</code> of the 
   *           designated <code>type</code>. 
   * @throws IllegalArgumentException if either <code>type</code> or 
   *           <code>provider</code> is <code>null</code>, or if