equal
deleted
inserted
replaced
358 public static Signature getInstance(String algorithm, String provider) |
358 public static Signature getInstance(String algorithm, String provider) |
359 throws NoSuchAlgorithmException, NoSuchProviderException { |
359 throws NoSuchAlgorithmException, NoSuchProviderException { |
360 Objects.requireNonNull(algorithm, "null algorithm name"); |
360 Objects.requireNonNull(algorithm, "null algorithm name"); |
361 if (algorithm.equalsIgnoreCase(RSA_SIGNATURE)) { |
361 if (algorithm.equalsIgnoreCase(RSA_SIGNATURE)) { |
362 // exception compatibility with existing code |
362 // exception compatibility with existing code |
363 if ((provider == null) || (provider.length() == 0)) { |
363 if (provider == null || provider.isEmpty()) { |
364 throw new IllegalArgumentException("missing provider"); |
364 throw new IllegalArgumentException("missing provider"); |
365 } |
365 } |
366 Provider p = Security.getProvider(provider); |
366 Provider p = Security.getProvider(provider); |
367 if (p == null) { |
367 if (p == null) { |
368 throw new NoSuchProviderException |
368 throw new NoSuchProviderException |