[JSch-users] Re: DH KeyPairGenerator not available or java.security.NoSuchAlgorithmException
Status: Alpha
Brought to you by:
ymnk
From: Romulus L. <rom...@ho...> - 2004-09-03 18:23:29
|
Hi, From the messages posted I can see there are some problems with various configurations and algorithms. Iâve had the same â or similar â problems and there are my findings: - When you get an java.security.NoSuchAlgorithmException it means that your Java security provider (it is usually packed in sunjce_provider.jar archive) either can not be found or it does not implements the required alghorithm. - java looks by default in JAVA_HOME\jre\lib\security\java.security file for lines like these: security.provider.1=sun.security.provider.Sun security.provider.2=com.sun.rsajca.Provider If you add your provider here it will be found by default and there will be no problems as long as you put the jar file in the classpath. If you donât add your provider in this file but put it in the classpath is still OK as long as you do a: Security.addProvider(new IBMJCE()); Before using the algohritm. - if you use an IDE ( I am using WebSphere Studio Application Developer which is based on Eclipse thus I suppose this applies to Eclipse users too) you must point to the jar file that have the provider inside it. - As a side note Iâve had some problems with the default security provider from Sun (some encryption algorithm not found when using JCE 1.2.X) and Iâve switched to one security provider from IBM: IBMJCE packed in ibmjceprovider.jar. Since then Iâve had no problems. I am sure that there are other packages out there for the encryption algorithms implementation. - Use the following piece of code to list what providers you are and what are they capable of: Provider[] provider = Security.getProviders(); for (int x = 0; x < provider.length; x++) { System.out.println(provider[x].getName()); System.out.println( "Provider information: " + provider[x].getInfo()); System.out.println( "Provider version: " + provider[x].getVersion()); Set entries = provider[x].entrySet(); Iterator iterator = entries.iterator(); while (iterator.hasNext()) { System.out.println(" Property entry: " + iterator.next()); } } I hope this helps. Romulus >From: "Singhal, Ankit (Ankit)" <asi...@lu...> >To: "'ym...@jc...'" <ym...@jc...> >CC: "'jsc...@li...'" <jsc...@li...> >Subject: [JSch-users] DH KeyPairGenerator not available >Date: Mon, 30 Aug 2004 19:37:24 +0530 > >Hi, > >I am running one of the Examples provided in JSCH in solaris server. I am >using JDK 1.3 and JCE 1.2.1. While running the program ,I have updated my >classpath with all the jars present in the JCE 1.2.1. /lib directory . When >I run the program it gave me java.security.NoSuchAlgorithmException: DH >KeyPairGenerator not available Exception. > >But when I copy all the jars from JCE 1.2.1. /lib to JRE_1.3.1/lib/ext >the >program runs fine . > >It means that it is mandatory for JSCH (copying all the security jars in >JRE_1.3.1/lib/ext ) while running it in JRE1.3 , if not then what is the >work around. > >The same problem I am getting in Windows Enviornment also. > >TIA >Ankit > > > >------------------------------------------------------- >This SF.Net email is sponsored by BEA Weblogic Workshop >FREE Java Enterprise J2EE developer tools! >Get your free copy of BEA WebLogic Workshop 8.1 today. >http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click >_______________________________________________ >JSch-users mailing list >JSc...@li... >https://lists.sourceforge.net/lists/listinfo/jsch-users _________________________________________________________________ Take charge with a pop-up guard built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*. |