code: public static Signature getInstance(String algorithm, String provider)
              throws NoSuchAlgorithmException, NoSuchProviderException {
          if (algorithm.equalsIgnoreCase(RSA_SIGNATURE)) {
              // exception compatibility with existing code
              if ((provider == null) || (provider.length() == 0)) {
                  throw new IllegalArgumentException("missing provider");
              }
              Provider p = Security.getProvider(provider);
              if (p == null) {
                  throw new NoSuchProviderException
                      ("no such provider: " + provider);
              }
              return getInstanceRSA(p);
          }
          Instance instance = GetInstance.getInstance
                  ("Signature", SignatureSpi.class, algorithm, provider);
          return getInstance(instance, algorithm);
      }
docs: Returns a Signature object that implements the specified signature
  algorithm.
  
  <p> A new Signature object encapsulating the
  SignatureSpi 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 name of the algorithm requested.
  See the Signature section in the <a href=
  "{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html#Signature">
  Java Cryptography Architecture Standard Algorithm Name Documentation</a>
  for information about standard algorithm names.
  
  @param provider the name of the provider.
  
  @return the new Signature object.
  
  @exception NoSuchAlgorithmException if a SignatureSpi
  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 provider name is null
  or empty.
  
  @see Provider