How to find out what algorithm [ encryption ] are supported by my JVM?

前端 未结 5 1305
执笔经年
执笔经年 2020-12-23 16:51

I am using Jasypt for encryption. This is my code:

public class Encryptor {    
    private final static StandardPBEStringEncryptor pbeEncryptor = new Standa         


        
5条回答
  •  粉色の甜心
    2020-12-23 17:47

    I tried the code posted by @Qwerky, but it's not very helpful. I had added the latest BouncyCastle provider, and the results I got were very confusing. This shows in better detail who's the provider, version, and the algorithm type and name.

    for (Provider provider : Security.getProviders()) {
        System.out.println("Provider: " + provider.getName() + " version: " + provider.getVersion());
        for (Provider.Service service : provider.getServices()) {
            System.out.printf("  Type : %-30s  Algorithm: %-30s\n", service.getType(), service.getAlgorithm());
        }
    }
    

提交回复
热议问题