Thursday, August 30, 2012

Write a program to list out provides in the JRE and services provides by each provider?

package com.suresh.security;

import java.security.Provider;
import java.security.Provider.Service;
import java.security.Security;
import java.util.Iterator;
import java.util.Set;


public class ListSecurityProviders {

   
    public static void main(String[] args) {
        Provider[] providers = Security.getProviders();
        for(Provider p:providers){
            System.out.println("Provider Name: "+ p.getName());
            Set service = p.getServices();
            Iterator itr = service.iterator();
            while(itr.hasNext()){
                Service s = (Service) itr.next();
                System.out.println(s.getAlgorithm());
            }
           
            System.out.println("\n\n\n");
        }
       
    }
}


Output:


Provider Name: SUN
services provided are :
SHA1PRNG
SHA1withDSA
NONEwithDSA
DSA
MD2
MD5
SHA
SHA-256
SHA-384
SHA-512
DSA
DSA
DSA
X.509
JKS
CaseExactJKS
JavaPolicy
JavaLoginConfig
PKIX
PKIX
LDAP
Collection
com.sun.security.IndexedCollection




Provider Name: SunRsaSign
services provided are :
RSA
RSA
MD2withRSA
MD5withRSA
SHA1withRSA
SHA256withRSA
SHA384withRSA
SHA512withRSA




Provider Name: SunJSSE
services provided are :
RSA
RSA
MD2withRSA
MD5withRSA
SHA1withRSA
MD5andSHA1withRSA
SunX509
NewSunX509
SunX509
PKIX
SSL
SSLv3
TLS
TLSv1
Default
PKCS12




Provider Name: SunJCE
services provided are :
RSA
DES
DESede
DESedeWrap
PBEWithMD5AndDES
PBEWithMD5AndTripleDES
PBEWithSHA1AndRC2_40
PBEWithSHA1AndDESede
Blowfish
AES
AESWrap
RC2
ARCFOUR
DES
DESede
Blowfish
AES
RC2
ARCFOUR
HmacMD5
HmacSHA1
HmacSHA256
HmacSHA384
HmacSHA512
DiffieHellman
DiffieHellman
DiffieHellman
DiffieHellman
DES
DESede
PBE
PBEWithMD5AndDES
PBEWithMD5AndTripleDES
PBEWithSHA1AndDESede
PBEWithSHA1AndRC2_40
Blowfish
AES
RC2
OAEP
DiffieHellman
DES
DESede
PBEWithMD5AndDES
PBEWithMD5AndTripleDES
PBEWithSHA1AndDESede
PBEWithSHA1AndRC2_40
PBKDF2WithHmacSHA1
HmacMD5
HmacSHA1
HmacSHA256
HmacSHA384
HmacSHA512
HmacPBESHA1
SslMacMD5
SslMacSHA1
JCEKS
SunTlsPrf
SunTlsRsaPremasterSecret
SunTlsMasterSecret
SunTlsKeyMaterial




Provider Name: SunJGSS
services provided are :
1.2.840.113554.1.2.2
1.3.6.1.5.5.2




Provider Name: SunSASL
services provided are :
DIGEST-MD5
GSSAPI
EXTERNAL
PLAIN
CRAM-MD5
CRAM-MD5
GSSAPI
DIGEST-MD5




Provider Name: XMLDSig
services provided are :
http://www.w3.org/2000/09/xmldsig#enveloped-signature
http://www.w3.org/2002/06/xmldsig-filter2
http://www.w3.org/2001/10/xml-exc-c14n#WithComments
http://www.w3.org/2001/10/xml-exc-c14n#
http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
DOM
http://www.w3.org/2000/09/xmldsig#base64
http://www.w3.org/TR/2001/REC-xml-c14n-20010315
http://www.w3.org/TR/1999/REC-xpath-19991116
http://www.w3.org/TR/1999/REC-xslt-19991116
DOM




Provider Name: SunPCSC
services provided are :
PC/SC







No comments:

Post a Comment