import java.security.Provider;
import java.security.Provider.Service;
import java.security.Security;
import org.junit.Test;
public class TestSecurity {
@Test
public void listSecurity(){
Provider[] providers=Security.getProviders();
for(Provider provider:providers){
System.out.println("provider name:"+provider.getName());
for(Service s:provider.getServices()){
System.out.println("类型:"+s.getType()+",算法:"+s.getAlgorithm());
}
System.out.println("------------------------");
}
}
}
provider name:SUN
类型:SecureRandom,算法:SHA1PRNG
类型:Signature,算法:SHA1withDSA
类型:Signature,算法:NONEwithDSA
类型:KeyPairGenerator,算法:DSA
类型:MessageDigest,算法:MD2
类型:MessageDigest,算法:MD5
类型:MessageDigest,算法:SHA
类型:MessageDigest,算法:SHA-256
类型:MessageDigest,算法:SHA-384
类型:MessageDigest,算法:SHA-512
类型:AlgorithmParameterGenerator,算法:DSA
类型:AlgorithmParameters,算法:DSA
类型:KeyFactory,算法:DSA
类型:CertificateFactory,算法:X.509
类型:KeyStore,算法:JKS
类型:KeyStore,算法:CaseExactJKS
类型:Policy,算法:JavaPolicy
类型:Configuration,算法:JavaLoginConfig
类型:CertPathBuilder,算法:PKIX
类型:CertPathValidator,算法:PKIX
类型:CertStore,算法:LDAP
类型:CertStore,算法:Collection
类型:CertStore,算法:com.sun.security.IndexedCollection
------------------------
provider name:SunRsaSign
类型:KeyFactory,算法:RSA
类型:KeyPairGenerator,算法:RSA
类型:Signature,算法:MD2withRSA
类型:Signature,算法:MD5withRSA
类型:Signature,算法:SHA1withRSA
类型:Signature,算法:SHA256withRSA
类型:Signature,算法:SHA384withRSA
类型:Signature,算法:SHA512withRSA
------------------------
provider name:SunEC
类型:KeyFactory,算法:EC
类型:AlgorithmParameters,算法:EC
类型:Signature,算法:NONEwithECDSA
类型:Signature,算法:SHA1withECDSA
类型:Signature,算法:SHA256withECDSA
类型:Signature,算法:SHA384withECDSA
类型:Signature,算法:SHA512withECDSA
类型:KeyPairGenerator,算法:EC
类型:KeyAgreement,算法:ECDH
------------------------
provider name:SunJSSE
类型:KeyFactory,算法:RSA
类型:KeyPairGenerator,算法:RSA
类型:Signature,算法:MD2withRSA
类型:Signature,算法:MD5withRSA
类型:Signature,算法:SHA1withRSA
类型:Signature,算法:MD5andSHA1withRSA
类型:KeyManagerFactory,算法:SunX509
类型:KeyManagerFactory,算法:NewSunX509
类型:TrustManagerFactory,算法:SunX509
类型:TrustManagerFactory,算法:PKIX
类型:SSLContext,算法:TLSv1
类型:SSLContext,算法:TLSv1.1
类型:SSLContext,算法:TLSv1.2
类型:SSLContext,算法:Default
类型:KeyStore,算法:PKCS12
------------------------
provider name:SunJCE
类型:Cipher,算法:RSA
类型:Cipher,算法:DES
类型:Cipher,算法:DESede
类型:Cipher,算法:DESedeWrap
类型:Cipher,算法:PBEWithMD5AndDES
类型:Cipher,算法:PBEWithMD5AndTripleDES
类型:Cipher,算法:PBEWithSHA1AndRC2_40
类型:Cipher,算法:PBEWithSHA1AndDESede
类型:Cipher,算法:Blowfish
类型:Cipher,算法:AES
类型:Cipher,算法:AESWrap
类型:Cipher,算法:RC2
类型:Cipher,算法:ARCFOUR
类型:KeyGenerator,算法:DES
类型:KeyGenerator,算法:DESede
类型:KeyGenerator,算法:Blowfish
类型:KeyGenerator,算法:AES
类型:KeyGenerator,算法:RC2
类型:KeyGenerator,算法:ARCFOUR
类型:KeyGenerator,算法:HmacMD5
类型:KeyGenerator,算法:HmacSHA1
类型:KeyGenerator,算法:HmacSHA256
类型:KeyGenerator,算法:HmacSHA384
类型:KeyGenerator,算法:HmacSHA512
类型:KeyPairGenerator,算法:DiffieHellman
类型:AlgorithmParameterGenerator,算法:DiffieHellman
类型:KeyAgreement,算法:DiffieHellman
类型:AlgorithmParameters,算法:DiffieHellman
类型:AlgorithmParameters,算法:DES
类型:AlgorithmParameters,算法:DESede
类型:AlgorithmParameters,算法:PBE
类型:AlgorithmParameters,算法:PBEWithMD5AndDES
类型:AlgorithmParameters,算法:PBEWithMD5AndTripleDES
类型:AlgorithmParameters,算法:PBEWithSHA1AndDESede
类型:AlgorithmParameters,算法:PBEWithSHA1AndRC2_40
类型:AlgorithmParameters,算法:Blowfish
类型:AlgorithmParameters,算法:AES
类型:AlgorithmParameters,算法:RC2
类型:AlgorithmParameters,算法:OAEP
类型:KeyFactory,算法:DiffieHellman
类型:SecretKeyFactory,算法:DES
类型:SecretKeyFactory,算法:DESede
类型:SecretKeyFactory,算法:PBEWithMD5AndDES
类型:SecretKeyFactory,算法:PBEWithMD5AndTripleDES
类型:SecretKeyFactory,算法:PBEWithSHA1AndDESede
类型:SecretKeyFactory,算法:PBEWithSHA1AndRC2_40
类型:SecretKeyFactory,算法:PBKDF2WithHmacSHA1
类型:Mac,算法:HmacMD5
类型:Mac,算法:HmacSHA1
类型:Mac,算法:HmacSHA256
类型:Mac,算法:HmacSHA384
类型:Mac,算法:HmacSHA512
类型:Mac,算法:HmacPBESHA1
类型:Mac,算法:SslMacMD5
类型:Mac,算法:SslMacSHA1
类型:KeyStore,算法:JCEKS
类型:KeyGenerator,算法:SunTlsPrf
类型:KeyGenerator,算法:SunTls12Prf
类型:KeyGenerator,算法:SunTlsMasterSecret
类型:KeyGenerator,算法:SunTlsKeyMaterial
类型:KeyGenerator,算法:SunTlsRsaPremasterSecret
------------------------
provider name:SunJGSS
类型:GssApiMechanism,算法:1.2.840.113554.1.2.2
类型:GssApiMechanism,算法:1.3.6.1.5.5.2
------------------------
provider name:SunSASL
类型:SaslClientFactory,算法:DIGEST-MD5
类型:SaslClientFactory,算法:NTLM
类型:SaslClientFactory,算法:GSSAPI
类型:SaslClientFactory,算法:EXTERNAL
类型:SaslClientFactory,算法:PLAIN
类型:SaslClientFactory,算法:CRAM-MD5
类型:SaslServerFactory,算法:CRAM-MD5
类型:SaslServerFactory,算法:GSSAPI
类型:SaslServerFactory,算法:DIGEST-MD5
类型:SaslServerFactory,算法:NTLM
------------------------
provider name:XMLDSig
类型:TransformService,算法:http://www.w3.org/2002/06/xmldsig-filter2
类型:TransformService,算法:http://www.w3.org/2000/09/xmldsig#enveloped-signature
类型:TransformService,算法:http://www.w3.org/2001/10/xml-exc-c14n#WithComments
类型:TransformService,算法:http://www.w3.org/2001/10/xml-exc-c14n#
类型:TransformService,算法:http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
类型:XMLSignatureFactory,算法:DOM
类型:TransformService,算法:http://www.w3.org/2006/12/xml-c14n11
类型:TransformService,算法:http://www.w3.org/2000/09/xmldsig#base64
类型:TransformService,算法:http://www.w3.org/TR/2001/REC-xml-c14n-20010315
类型:TransformService,算法:http://www.w3.org/TR/1999/REC-xpath-19991116
类型:TransformService,算法:http://www.w3.org/TR/1999/REC-xslt-19991116
类型:TransformService,算法:http://www.w3.org/2006/12/xml-c14n11#WithComments
类型:KeyInfoFactory,算法:DOM
------------------------
provider name:SunPCSC
类型:TerminalFactory,算法:PC/SC
------------------------
provider name:SunMSCAPI
类型:SecureRandom,算法:Windows-PRNG
类型:KeyStore,算法:Windows-MY
类型:KeyStore,算法:Windows-ROOT
类型:Signature,算法:NONEwithRSA
类型:Signature,算法:SHA1withRSA
类型:Signature,算法:SHA256withRSA
类型:Signature,算法:SHA384withRSA
类型:Signature,算法:SHA512withRSA
类型:Signature,算法:MD5withRSA
类型:Signature,算法:MD2withRSA
类型:KeyPairGenerator,算法:RSA
类型:Cipher,算法:RSA
类型:Cipher,算法:RSA/ECB/PKCS1Padding
------------------------
上面是代码直接遍历的结果;
转自:点击打开链接