- codul sursa
import java.util.*;
import java.security.*;
import javax.crypto.*;
import java.io.*;
public class ListareServicii{
// metoda ce returneaza serviciile pentru toti furnizorii de servicii de criptografie instalati
// sub forma unui array de String-uri
public static String[] getServiceTypes() {
Set result = new HashSet();
Provider[] providers = Security.getProviders();
// si pentru fiecare
for (int i=0; i<providers.length; i++) {
// construiesc lista cu descrierile native ale serviciilor
Set serviciile = providers[i].getServices();
for ( Iterator it=serviciile.iterator(); it.hasNext(); ) {
Provider.Service serviciul = (Provider.Service)it.next();
result.add(serviciul.toString());
}
}
return (String[])result.toArray(new String[result.size()]);
}
// main-ul
public static void main(String[] argumente) {
// afisare servicii si implementarile lor
ListareServicii testul = new ListareServicii();
String[] serviciile = testul.getServiceTypes();
for (int i=0; i<serviciile.length; i++) {
System.out.println("Serviciul este: "+serviciile[i]);
}
}
}
- exemplu rulare
-
Serviciul este: SunJCE: Cipher.PBEWithSHA1AndRC2_40 -> com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndRC2_40
aliases: [OID.1.2.840.113549.1.12.1.6, 1.2.840.113549.1.12.1.6]
-
Serviciul este: SunJCE: AlgorithmParameters.DESede -> com.sun.crypto.provider.DESedeParameters
aliases: [TripleDES]
-
Serviciul este: SunJCE: SecretKeyFactory.DES -> com.sun.crypto.provider.DESKeyFactory
-
Serviciul este: SunSASL: SaslServerFactory.DIGEST-MD5 -> com.sun.security.sasl.digest.FactoryImpl
-
Serviciul este: SunJCE: SecretKeyFactory.PBEWithMD5AndDES -> com.sun.crypto.provider.PBEKeyFactory
aliases: [OID.1.2.840.113549.1.5.3, 1.2.840.113549.1.5.3]
-
Serviciul este: SunJCE: Mac.HmacSHA256 -> com.sun.crypto.provider.HmacCore$HmacSHA256
attributes: {SupportedKeyFormats=RAW}
-
Serviciul este: SunJSSE: SSLContext.SSLv3 -> com.sun.net.ssl.internal.ssl.SSLContextImpl
-
Serviciul este: SunJSSE: TrustManagerFactory.PKIX -> com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl$PKIXFactory
aliases: [SunPKIX, X509, X.509]
-
Serviciul este: SunRsaSign: Signature.SHA1withRSA -> sun.security.rsa.RSASignature$SHA1withRSA
aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5, 1.3.14.3.2.29]
attributes: {SupportedKeyClasses=java.security.interfaces.RSAPublicKey|java.security.interfaces.RSAPrivateKey}
-
Serviciul este: SunJCE: KeyGenerator.DESede -> com.sun.crypto.provider.DESedeKeyGenerator
aliases: [TripleDES]
-
Serviciul este: SunJCE: KeyGenerator.ARCFOUR -> com.sun.crypto.provider.KeyGeneratorCore$ARCFOURKeyGenerator
aliases: [RC4]
-
Serviciul este: SunJCE: AlgorithmParameters.DES -> com.sun.crypto.provider.DESParameters
-
Serviciul este: SUN: MessageDigest.MD2 -> sun.security.provider.MD2
-
Serviciul este: SunJSSE: SSLContext.TLS -> com.sun.net.ssl.internal.ssl.SSLContextImpl
-
Serviciul este: SunJCE: AlgorithmParameters.PBEWithSHA1AndRC2_40 -> com.sun.crypto.provider.PBEParameters
aliases: [OID.1.2.840.113549.1.12.1.6, 1.2.840.113549.1.12.1.6]
-
Serviciul este: SUN: CertificateFactory.X.509 -> sun.security.provider.X509Factory
aliases: [X509]
attributes: {ImplementedIn=Software}
-
Serviciul este: SunJSSE: Signature.MD2withRSA -> sun.security.rsa.RSASignature$MD2withRSA
aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2]
-
Serviciul este: SunJCE: Cipher.ARCFOUR -> com.sun.crypto.provider.ARCFOURCipher
aliases: [RC4]
attributes: {SupportedModes=ECB, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING}
-
Serviciul este: SunJCE: Cipher.RSA -> com.sun.crypto.provider.RSACipher
attributes: {SupportedModes=ECB, SupportedKeyClasses=java.security.interfaces.RSAPublicKey|java.security.interfaces.RSAPrivateKey, SupportedPaddings=NOPADDING|PKCS1PADDING|OAEPWITHMD5ANDMGF1PADDING|OAEPWITHSHA1ANDMGF1PADDING|OAEPWITHSHA-1ANDMGF1PADDING|OAEPWITHSHA-256ANDMGF1PADDING|OAEPWITHSHA-384ANDMGF1PADDING|OAEPWITHSHA-512ANDMGF1PADDING}
-
Serviciul este: SUN: KeyStore.JKS -> sun.security.provider.JavaKeyStore$JKS
attributes: {ImplementedIn=Software}
-
Serviciul este: SunJCE: Mac.HmacSHA384 -> com.sun.crypto.provider.HmacCore$HmacSHA384
attributes: {SupportedKeyFormats=RAW}
-
Serviciul este: SunJCE: KeyGenerator.AES -> com.sun.crypto.provider.AESKeyGenerator
aliases: [Rijndael]
-
Serviciul este: SUN: Signature.NONEwithDSA -> sun.security.provider.DSA$RawDSA
aliases: [RawDSA]
attributes: {SupportedKeyClasses=java.security.interfaces.DSAPublicKey|java.security.interfaces.DSAPrivateKey}
-
Serviciul este: SunJCE: Cipher.Blowfish -> com.sun.crypto.provider.BlowfishCipher
attributes: {SupportedModes=ECB|CBC|PCBC|CTR|CFB|OFB|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING|PKCS5PADDING|ISO10126PADDING}
-
Serviciul este: SunJGSS: GssApiMechanism.1.2.840.113554.1.2.2 -> sun.security.jgss.krb5.Krb5MechFactory
-
Serviciul este: SunJCE: SecretKeyFactory.DESede -> com.sun.crypto.provider.DESedeKeyFactory
aliases: [TripleDES]
-
Serviciul este: SunJCE: KeyGenerator.Blowfish -> com.sun.crypto.provider.BlowfishKeyGenerator
-
Serviciul este: SunJCE: KeyGenerator.RC2 -> com.sun.crypto.provider.KeyGeneratorCore$RC2KeyGenerator
-
Serviciul este: SunJCE: Cipher.DESedeWrap -> com.sun.crypto.provider.DESedeWrapCipher
attributes: {SupportedModes=CBC, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING}
-
Serviciul este: SunJCE: AlgorithmParameters.RC2 -> com.sun.crypto.provider.RC2Parameters
-
Serviciul este: SunJCE: Cipher.AES -> com.sun.crypto.provider.AESCipher
aliases: [Rijndael]
attributes: {SupportedModes=ECB|CBC|PCBC|CTR|CFB|OFB|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64|CFB72|CFB80|CFB88|CFB96|CFB104|CFB112|CFB120|CFB128|OFB72|OFB80|OFB88|OFB96|OFB104|OFB112|OFB120|OFB128, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING|PKCS5PADDING|ISO10126PADDING}
-
Serviciul este: SunJCE: KeyGenerator.HmacMD5 -> com.sun.crypto.provider.HmacMD5KeyGenerator
-
Serviciul este: SunJCE: Mac.HmacMD5 -> com.sun.crypto.provider.HmacMD5
attributes: {SupportedKeyFormats=RAW}
-
Serviciul este: SUN: MessageDigest.MD5 -> sun.security.provider.MD5
attributes: {ImplementedIn=Software}
-
Serviciul este: SunRsaSign: Signature.SHA512withRSA -> sun.security.rsa.RSASignature$SHA512withRSA
aliases: [1.2.840.113549.1.1.13, OID.1.2.840.113549.1.1.13]
attributes: {SupportedKeyClasses=java.security.interfaces.RSAPublicKey|java.security.interfaces.RSAPrivateKey}
-
Serviciul este: SUN: CertStore.LDAP -> sun.security.provider.certpath.LDAPCertStore
attributes: {ImplementedIn=Software, LDAPSchema=RFC2587}
-
Serviciul este: SunJSSE: TrustManagerFactory.SunX509 -> com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl$SimpleFactory
-
Serviciul este: SUN: SecureRandom.SHA1PRNG -> sun.security.provider.SecureRandom
attributes: {ImplementedIn=Software}
-
Serviciul este: SunJCE: Cipher.PBEWithMD5AndTripleDES -> com.sun.crypto.provider.PBEWithMD5AndTripleDESCipher
-
Serviciul este: SunJCE: KeyStore.JCEKS -> com.sun.crypto.provider.JceKeyStore
-
Serviciul este: SunJCE: AlgorithmParameters.Blowfish -> com.sun.crypto.provider.BlowfishParameters
-
Serviciul este: SunJCE: SecretKeyFactory.PBEWithSHA1AndRC2_40 -> com.sun.crypto.provider.PBEKeyFactory
aliases: [OID.1.2.840.113549.1.12.1.6, 1.2.840.113549.1.12.1.6]
-
Serviciul este: SunJCE: Cipher.RC2 -> com.sun.crypto.provider.RC2Cipher
attributes: {SupportedModes=ECB|CBC|PCBC|CTR|CFB|OFB|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING|PKCS5PADDING|ISO10126PADDING}
-
Serviciul este: SunJSSE: Signature.MD5andSHA1withRSA -> com.sun.net.ssl.internal.ssl.RSASignature
-
Serviciul este: SunJCE: SecretKeyFactory.PBEWithSHA1AndDESede -> com.sun.crypto.provider.PBEKeyFactory
aliases: [OID.1.2.840.113549.1.12.1.3, 1.2.840.113549.1.12.1.3]
-
Serviciul este: SunJCE: KeyGenerator.HmacSHA1 -> com.sun.crypto.provider.HmacSHA1KeyGenerator
-
Serviciul este: SunJCE: AlgorithmParameters.PBEWithMD5AndTripleDES -> com.sun.crypto.provider.PBEParameters
-
Serviciul este: SunJSSE: KeyManagerFactory.SunX509 -> com.sun.net.ssl.internal.ssl.KeyManagerFactoryImpl$SunX509
-
Serviciul este: SunJCE: AlgorithmParameters.PBEWithMD5AndDES -> com.sun.crypto.provider.PBEParameters
aliases: [OID.1.2.840.113549.1.5.3, 1.2.840.113549.1.5.3]
-
Serviciul este: SUN: Signature.SHA1withDSA -> sun.security.provider.DSA$SHA1withDSA
aliases: [DSA, DSS, SHA/DSA, SHA-1/DSA, SHA1/DSA, SHAwithDSA, DSAWithSHA1, OID.1.2.840.10040.4.3, 1.2.840.10040.4.3, 1.3.14.3.2.13, 1.3.14.3.2.27]
attributes: {ImplementedIn=Software, KeySize=1024, SupportedKeyClasses=java.security.interfaces.DSAPublicKey|java.security.interfaces.DSAPrivateKey}
-
Serviciul este: SunRsaSign: Signature.MD2withRSA -> sun.security.rsa.RSASignature$MD2withRSA
aliases: [1.2.840.113549.1.1.2, OID.1.2.840.113549.1.1.2]
attributes: {SupportedKeyClasses=java.security.interfaces.RSAPublicKey|java.security.interfaces.RSAPrivateKey}
-
Serviciul este: SunRsaSign: Signature.MD5withRSA -> sun.security.rsa.RSASignature$MD5withRSA
aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4]
attributes: {SupportedKeyClasses=java.security.interfaces.RSAPublicKey|java.security.interfaces.RSAPrivateKey}
-
Serviciul este: SunJCE: Mac.HmacSHA512 -> com.sun.crypto.provider.HmacCore$HmacSHA512
attributes: {SupportedKeyFormats=RAW}
-
Serviciul este: SunJCE: AlgorithmParameterGenerator.DiffieHellman -> com.sun.crypto.provider.DHParameterGenerator
aliases: [DH, OID.1.2.840.113549.1.3.1, 1.2.840.113549.1.3.1]
-
Serviciul este: SUN: CertPathValidator.PKIX -> sun.security.provider.certpath.PKIXCertPathValidator
attributes: {ImplementedIn=Software, ValidationAlgorithm=RFC3280}
-
Serviciul este: SUN: CertStore.Collection -> sun.security.provider.certpath.CollectionCertStore
attributes: {ImplementedIn=Software}
-
Serviciul este: SunJCE: Cipher.AESWrap -> com.sun.crypto.provider.AESWrapCipher
attributes: {SupportedModes=ECB, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING}
-
Serviciul este: SunJCE: AlgorithmParameters.DiffieHellman -> com.sun.crypto.provider.DHParameters
aliases: [DH, OID.1.2.840.113549.1.3.1, 1.2.840.113549.1.3.1]
-
Serviciul este: SUN: CertStore.com.sun.security.IndexedCollection -> sun.security.provider.certpath.IndexedCollectionCertStore
attributes: {ImplementedIn=Software}
-
Serviciul este: SunJCE: AlgorithmParameters.PBEWithSHA1AndDESede -> com.sun.crypto.provider.PBEParameters
aliases: [OID.1.2.840.113549.1.12.1.3, 1.2.840.113549.1.12.1.3]
-
Serviciul este: SunSASL: SaslClientFactory.DIGEST-MD5 -> com.sun.security.sasl.digest.FactoryImpl
-
Serviciul este: SunRsaSign: KeyPairGenerator.RSA -> sun.security.rsa.RSAKeyPairGenerator
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
-
Serviciul este: SunJSSE: Signature.MD5withRSA -> sun.security.rsa.RSASignature$MD5withRSA
aliases: [1.2.840.113549.1.1.4, OID.1.2.840.113549.1.1.4]
-
Serviciul este: SUN: AlgorithmParameters.DSA -> sun.security.provider.DSAParameters
aliases: [1.3.14.3.2.12, 1.2.840.10040.4.1]
attributes: {ImplementedIn=Software}
-
Serviciul este: SunSASL: SaslClientFactory.EXTERNAL -> com.sun.security.sasl.ClientFactoryImpl
-
Serviciul este: SUN: KeyFactory.DSA -> sun.security.provider.DSAKeyFactory
aliases: [1.3.14.3.2.12, 1.2.840.10040.4.1]
attributes: {ImplementedIn=Software}
-
Serviciul este: SUN: MessageDigest.SHA-256 -> sun.security.provider.SHA2
-
Serviciul este: SunJCE: SecretKeyFactory.PBEWithMD5AndTripleDES -> com.sun.crypto.provider.PBEKeyFactory
-
Serviciul este: SunJCE: Mac.HmacSHA1 -> com.sun.crypto.provider.HmacSHA1
attributes: {SupportedKeyFormats=RAW}
-
Serviciul este: SunJCE: AlgorithmParameters.OAEP -> com.sun.crypto.provider.OAEPParameters
-
Serviciul este: SunJCE: Cipher.PBEWithSHA1AndDESede -> com.sun.crypto.provider.PKCS12PBECipherCore$PBEWithSHA1AndDESede
aliases: [OID.1.2.840.113549.1.12.1.3, 1.2.840.113549.1.12.1.3]
-
Serviciul este: SunJCE: KeyGenerator.HmacSHA512 -> com.sun.crypto.provider.KeyGeneratorCore$HmacSHA512KG
-
Serviciul este: SunJCE: KeyGenerator.DES -> com.sun.crypto.provider.DESKeyGenerator
-
Serviciul este: SunJCE: KeyGenerator.HmacSHA256 -> com.sun.crypto.provider.KeyGeneratorCore$HmacSHA256KG
-
Serviciul este: SunJSSE: SSLContext.SSL -> com.sun.net.ssl.internal.ssl.SSLContextImpl
-
Serviciul este: SUN: CertPathBuilder.PKIX -> sun.security.provider.certpath.SunCertPathBuilder
attributes: {ImplementedIn=Software, ValidationAlgorithm=RFC3280}
-
Serviciul este: SunJCE: Cipher.DES -> com.sun.crypto.provider.DESCipher
attributes: {SupportedModes=ECB|CBC|PCBC|CTR|CFB|OFB|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING|PKCS5PADDING|ISO10126PADDING}
-
Serviciul este: SunRsaSign: Signature.SHA256withRSA -> sun.security.rsa.RSASignature$SHA256withRSA
aliases: [1.2.840.113549.1.1.11, OID.1.2.840.113549.1.1.11]
attributes: {SupportedKeyClasses=java.security.interfaces.RSAPublicKey|java.security.interfaces.RSAPrivateKey}
-
Serviciul este: SunJSSE: KeyStore.PKCS12 -> com.sun.net.ssl.internal.ssl.PKCS12KeyStore
-
Serviciul este: SUN: MessageDigest.SHA-384 -> sun.security.provider.SHA5$SHA384
-
Serviciul este: SUN: KeyPairGenerator.DSA -> sun.security.provider.DSAKeyPairGenerator
aliases: [OID.1.2.840.10040.4.1, 1.2.840.10040.4.1, 1.3.14.3.2.12]
attributes: {ImplementedIn=Software, KeySize=1024}
-
Serviciul este: SunJCE: Cipher.PBEWithMD5AndDES -> com.sun.crypto.provider.PBEWithMD5AndDESCipher
aliases: [OID.1.2.840.113549.1.5.3, 1.2.840.113549.1.5.3]
-
Serviciul este: SunSASL: SaslServerFactory.GSSAPI -> com.sun.security.sasl.gsskerb.FactoryImpl
-
Serviciul este: SunJCE: SecretKeyFactory.PBE -> com.sun.crypto.provider.PBEKeyFactory
-
Serviciul este: SunJCE: Cipher.DESede -> com.sun.crypto.provider.DESedeCipher
aliases: [TripleDES]
attributes: {SupportedModes=ECB|CBC|PCBC|CTR|CFB|OFB|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64, SupportedKeyFormats=RAW, SupportedPaddings=NOPADDING|PKCS5PADDING|ISO10126PADDING}
-
Serviciul este: SUN: MessageDigest.SHA -> sun.security.provider.SHA
aliases: [SHA-1, SHA1]
attributes: {ImplementedIn=Software}
-
Serviciul este: SunJSSE: KeyFactory.RSA -> sun.security.rsa.RSAKeyFactory
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
-
Serviciul este: SunSASL: SaslClientFactory.CRAM-MD5 -> com.sun.security.sasl.ClientFactoryImpl
-
Serviciul este: SunJSSE: KeyManagerFactory.NewSunX509 -> com.sun.net.ssl.internal.ssl.KeyManagerFactoryImpl$X509
-
Serviciul este: SunJCE: Mac.HmacPBESHA1 -> com.sun.crypto.provider.HmacPKCS12PBESHA1
attributes: {SupportedKeyFormats=RAW}
-
Serviciul este: SunSASL: SaslClientFactory.GSSAPI -> com.sun.security.sasl.gsskerb.FactoryImpl
-
Serviciul este: SunJSSE: SSLContext.TLSv1 -> com.sun.net.ssl.internal.ssl.SSLContextImpl
-
Serviciul este: SunRsaSign: KeyFactory.RSA -> sun.security.rsa.RSAKeyFactory
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
-
Serviciul este: SunJCE: AlgorithmParameters.PBE -> com.sun.crypto.provider.PBEParameters
-
Serviciul este: SUN: MessageDigest.SHA-512 -> sun.security.provider.SHA5$SHA512
-
Serviciul este: SunJCE: KeyFactory.DiffieHellman -> com.sun.crypto.provider.DHKeyFactory
aliases: [DH, OID.1.2.840.113549.1.3.1, 1.2.840.113549.1.3.1]
-
Serviciul este: SunSASL: SaslServerFactory.CRAM-MD5 -> com.sun.security.sasl.ServerFactoryImpl
-
Serviciul este: SunJCE: KeyGenerator.HmacSHA384 -> com.sun.crypto.provider.KeyGeneratorCore$HmacSHA384KG
-
Serviciul este: SunJCE: KeyAgreement.DiffieHellman -> com.sun.crypto.provider.DHKeyAgreement
aliases: [DH, OID.1.2.840.113549.1.3.1, 1.2.840.113549.1.3.1]
attributes: {SupportedKeyClasses=javax.crypto.interfaces.DHPublicKey|javax.crypto.interfaces.DHPrivateKey}
-
Serviciul este: SUN: KeyStore.CaseExactJKS -> sun.security.provider.JavaKeyStore$CaseExactJKS
-
Serviciul este: SunJSSE: Signature.SHA1withRSA -> sun.security.rsa.RSASignature$SHA1withRSA
aliases: [1.2.840.113549.1.1.5, OID.1.2.840.113549.1.1.5, 1.3.14.3.2.29, OID.1.3.14.3.2.29]
-
Serviciul este: SunJSSE: KeyPairGenerator.RSA -> sun.security.rsa.RSAKeyPairGenerator
aliases: [1.2.840.113549.1.1, OID.1.2.840.113549.1.1]
-
Serviciul este: SunRsaSign: Signature.SHA384withRSA -> sun.security.rsa.RSASignature$SHA384withRSA
aliases: [1.2.840.113549.1.1.12, OID.1.2.840.113549.1.1.12]
attributes: {SupportedKeyClasses=java.security.interfaces.RSAPublicKey|java.security.interfaces.RSAPrivateKey}
-
Serviciul este: SUN: AlgorithmParameterGenerator.DSA -> sun.security.provider.DSAParameterGenerator
attributes: {ImplementedIn=Software, KeySize=1024}
-
Serviciul este: SunSASL: SaslClientFactory.PLAIN -> com.sun.security.sasl.ClientFactoryImpl
-
Serviciul este: SunJCE: AlgorithmParameters.AES -> com.sun.crypto.provider.AESParameters
aliases: [Rijndael]
-
Serviciul este: SunJCE: KeyPairGenerator.DiffieHellman -> com.sun.crypto.provider.DHKeyPairGenerator
aliases: [DH, OID.1.2.840.113549.1.3.1, 1.2.840.113549.1.3.1]
# posted by Sorin Badescu @ 12:51 PM