zer0stimulus
zer0stimulus

Reputation: 23606

Java: How to view all available providers for a Cipher?

For a specified Cipher, say RSA/ECB/PKCS1Padding, how can I view which Providers are available for it? I need to reference it by name, that is usable with the getInstance(String transformation, String provider) overload.

Upvotes: 0

Views: 92

Answers (1)

Ted Shaw
Ted Shaw

Reputation: 2306

    Provider[] provides=Security.getProviders("Cipher.RSA");
    for (int i = 0; i < provides.length; i++) {
        System.out.println("provider:"+provides[i].getName());            
    }

Upvotes: 2

Related Questions