summaryrefslogtreecommitdiffstats
path: root/harmony-tests/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'harmony-tests/src/test')
-rw-r--r--harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java
index 26403f5..093e2e1 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/X509CertificateTest.java
@@ -39,6 +39,7 @@ import java.security.Principal;
import java.security.Provider;
import java.security.PublicKey;
import java.security.Security;
+import java.security.Signature;
import java.security.SignatureException;
import java.security.Provider.Service;
import java.security.cert.CertificateFactory;
@@ -763,16 +764,16 @@ public class X509CertificateTest extends TestCase {
}
Security.addProvider(myProvider);
- Provider[] providers = Security.getProviders("Signature.MD5withRSA");
- if (providers == null || providers.length == 0) {
- fail("no Provider for Signature.MD5withRSA");
- return;
- }
+ // Find the Provider which offers MD5withRSA for the certificate's
+ // public key.
+ Signature signature = Signature.getInstance("MD5withRSA");
+ signature.initVerify(javaxSSCert.getPublicKey());
+ Provider provider = signature.getProvider();
// self signed cert: should verify with provider
try {
javaxSSCert.verify(javaxSSCert.getPublicKey(),
- providers[0].getName());
+ provider.getName());
} catch (SignatureException e) {
fail("blu");
}