logback-android/src/main/java/ch/qos/logback/core/net/ssl/SecureRandomFactoryBean.java
public SecureRandom createSecureRandom() throws NoSuchProviderException,
      NoSuchAlgorithmException {
    try {
      return getProvider() != null ?
          SecureRandom.getInstance(getAlgorithm(), getProvider())
          : SecureRandom.getInstance(getAlgorithm());
    }
    catch (NoSuchProviderException ex) {
      throw new NoSuchProviderException("no such secure random provider: "
          + getProvider());
    }
    catch (NoSuchAlgorithmException ex) {
      throw new NoSuchAlgorithmException("no such secure random algorithm: "
          + getAlgorithm());
    }
  }
public SecureRandom createSecureRandom() throws NoSuchProviderException,
      NoSuchAlgorithmException {
    try {
      return getProvider() != null ?
          SecureRandom.getInstance(getAlgorithm(), getProvider())
          : SecureRandom.getInstance(getAlgorithm());
    }
    catch (NoSuchProviderException ex) {
      throw new NoSuchProviderException("no such secure random provider: "
          + getProvider());
    }
    catch (NoSuchAlgorithmException ex) {
      throw new NoSuchAlgorithmException("no such secure random algorithm: "
          + getAlgorithm());
    }
  }
Creates a new {@link SecureRandom} generator using the receiver's
configuration.
@return secure random generator instance
@throws NoSuchProviderException if the provider name specified by
{@link #setProvider(String)} is not known to the platform
@throws NoSuchAlgorithmException if the algorithm name specified by
{@link #setAlgorithm(String)} is not recognized by the specified
provider (or the platform's default provider if the provider isn't
specified)