[jboss-jira] [JBoss JIRA] Updated: (JBAS-3400) JaasSecurityManagerService can show security provider/JCA algorithm information
Dimitris Andreadis (JIRA)
jira-events at jboss.com
Fri Jan 26 06:08:57 EST 2007
[ http://jira.jboss.com/jira/browse/JBAS-3400?page=all ]
Dimitris Andreadis updated JBAS-3400:
-------------------------------------
Fix Version/s: JBossAS-4.2.0.GA
(was: JBossAS-4.2.0.CR1)
> JaasSecurityManagerService can show security provider/JCA algorithm information
> -------------------------------------------------------------------------------
>
> Key: JBAS-3400
> URL: http://jira.jboss.com/jira/browse/JBAS-3400
> Project: JBoss Application Server
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Security
> Affects Versions: JBossAS-4.0.4.GA
> Reporter: Anil Saldhana
> Assigned To: Sohil Shah
> Priority: Optional
> Fix For: JBossAS-3.2.8.SP2, JBossAS-5.0.0.Beta2, JBossAS-4.2.0.GA
>
>
> It may be useful to determine the security providers and the various JCA algorithms installed in the JDK.
> So, add two methods to the JaasSecurityManagerService as follows:
> - showProviders()
> - getAlgorithm(String serviceName)
> If the serviceName is null, show all the possible JCA service names.
> Here is a partial tested code, that you may want to adapt:
> ======================================================================================
> import java.security.*;
> import java.util.*;
> public class A
> {
> public static void main(String[] args)
> {
> Provider[] providers = Security.getProviders();
> for(int i = 0; i < providers.length; i++)
> {
> System.out.println("Provider="+providers[i].toString());
> }
>
> System.out.println("Printing JCA Algorithm Information");
> printJCAAlgorithm("Cipher");
> printJCAAlgorithm("Signature");
> printJCAAlgorithm("KeyFactory");
> printJCAAlgorithm("SecretKeyFactory");
> printJCAAlgorithm("AlgorithmParameters");
> printJCAAlgorithm("MessageDigest");
> printJCAAlgorithm("Mac");
> }
>
> private static void printJCAAlgorithm(String sName)
> {
> System.out.println("Printing "+sName);
> Set md2 = Security.getAlgorithms(sName);
> System.out.println(sName + " set length="+md2.size());
> Iterator md2iter = md2.iterator();
> while(md2iter.hasNext())
> {
> System.out.println(md2iter.next().toString());
> }
> }
> }
> ====================================================================================
> The output is:
> asaldhana~/testSecurity>java -cp . -Djava.security.manager A
> Provider=SUN version 1.5
> Provider=SunRsaSign version 1.5
> Provider=SunJSSE version 1.5
> Provider=SunJCE version 1.5
> Provider=SunJGSS version 1.0
> Provider=SunSASL version 1.5
> Printing JCA Algorithm Information
> Printing Cipher
> Cipher set length=13
> ARCFOUR
> PBEWITHSHA1ANDDESEDE
> DESEDEWRAP
> PBEWITHMD5ANDTRIPLEDES
> DESEDE
> RSA
> AESWRAP
> AES
> PBEWITHMD5ANDDES
> BLOWFISH
> DES
> RC2
> PBEWITHSHA1ANDRC2_40
> Printing Signature
> Signature set length=9
> SHA256WITHRSA
> NONEWITHDSA
> ....
> Make the changes in HEAD. I will port it to Branch_4_0 and Branch_3_2
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list