Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2005

Tip: Looking for answers? Try searching our database.

Cryptix OpenPGP - DSA algorithm not found/DSA Signature not available

Thread view: 
Ido.Yehieli@gmail.com - 27 Sep 2005 10:06 GMT
Hi all,
   I'm having a bit of a problem getting cryptix-openpgp (the latest
version 20050418-snap from http://www.cryptix.org/) to work. I've
followed the readme file:

1.installed SUN's "Unlimited Strength Jurisdiction Policy files"
2.changed $JAVA_HOME/jre/lib/security/java.security to inclued:
 security.provider.1=cryptix.jce.provider.CryptixCrypto
 security.provider.2=cryptix.openpgp.provider.CryptixOpenPGP
3.compiled the examples with:
~/openpgp/examples$ javac -classpath
../cryptix-openpgp-provider.jar:../cryptix-message-api.jar:../cryptix-pki-api.jar:../certpath-api-compat.jar:../bin/cryptix-jce-provider.jar:../bin/cryptix-jce-api.jar
cryptix/openpgp/examples/*.java

(no errors)

4.tryed to run one of the examples (GenerateAndWriteKey is required to
run the rest it seems) with:

~/openpgp/examples$ java -classpath
../cryptix-openpgp-provider.jar:../cryptix-message-api.jar:../cryptix-pki-api.jar:../certpath-api-compat.jar:../bin/cryptix-jce-provider.jar:../bin/cryptix-jce-api.jar:.
cryptix/openpgp/examples/GenerateAndWriteKey

and got the following error:

java.security.NoSuchAlgorithmException: DSA Signature not available
       at java.security.Signature.getInstance(Signature.java:208)
       at
cryptix.openpgp.algorithm.PGPDSA.initSigObject(PGPDSA.java:128)
       at cryptix.openpgp.algorithm.PGPDSA.<init>(PGPDSA.java:82)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at java.lang.Class.newInstance0(Class.java:350)
       at java.lang.Class.newInstance(Class.java:303)
       at
cryptix.openpgp.algorithm.PGPAlgorithmFactory.getPublicKeyAlgorithm(PGPAlgorithmFactory.java:445)
       at
cryptix.openpgp.provider.PGPKeyPairGenerator.generateKeyPair(PGPKeyPairGenerator.java:138)
       at
java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:638)
       at
cryptix.openpgp.examples.GenerateAndWriteKey.generateSimpleKey(GenerateAndWriteKey.java:160)
       at
cryptix.openpgp.examples.GenerateAndWriteKey.main(GenerateAndWriteKey.java:89)
Exception in thread "main" java.lang.RuntimeException: DSA algorithm
not found
       at
cryptix.openpgp.algorithm.PGPDSA.initSigObject(PGPDSA.java:131)
       at cryptix.openpgp.algorithm.PGPDSA.<init>(PGPDSA.java:82)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at
java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at java.lang.Class.newInstance0(Class.java:350)
       at java.lang.Class.newInstance(Class.java:303)
       at
cryptix.openpgp.algorithm.PGPAlgorithmFactory.getPublicKeyAlgorithm(PGPAlgorithmFactory.java:445)
       at
cryptix.openpgp.provider.PGPKeyPairGenerator.generateKeyPair(PGPKeyPairGenerator.java:138)
       at
java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:638)
       at
cryptix.openpgp.examples.GenerateAndWriteKey.generateSimpleKey(GenerateAndWriteKey.java:160)
       at
cryptix.openpgp.examples.GenerateAndWriteKey.main(GenerateAndWriteKey.java:89)

changeing to other algorithms like didn't help. when i changed the
example to use RSA i got:

Exception in thread "main" java.lang.ExceptionInInitializerError
       at javax.crypto.Cipher.getInstance(DashoA12275)
       at javax.crypto.Cipher.getInstance(DashoA12275)
       at
cryptix.openpgp.algorithm.PGPAlgorithmFactory.getCipherAlgorithm(PGPAlgorithmFactory.java:675)
       at
cryptix.openpgp.packet.PGPKeyPacket.encrypt(PGPKeyPacket.java:426)
       at
cryptix.openpgp.provider.PGPKeyBundleImpl.addPrivateKey(PGPKeyBundleImpl.java:340)
       at
cryptix.openpgp.examples.GenerateAndWriteKey.generateSimpleKey(GenerateAndWriteKey.java:244)
       at
cryptix.openpgp.examples.GenerateAndWriteKey.main(GenerateAndWriteKey.java:89)
Caused by: java.lang.SecurityException: Cannot set up certs for trusted
CAs
       at javax.crypto.SunJCE_b.<clinit>(DashoA12275)
       ... 7 more
Caused by: java.security.PrivilegedActionException:
java.security.cert.CertificateException: X.509 not found
       at java.security.AccessController.doPrivileged(Native Method)
       ... 8 more
Caused by: java.security.cert.CertificateException: X.509 not found
       at
java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:146)
       at javax.crypto.SunJCE_q.run(DashoA12275)
       ... 9 more
Caused by: java.security.NoSuchAlgorithmException: X.509
CertificateFactory not available
       at
sun.security.jca.GetInstance.getInstance(GetInstance.java:142)
       at
java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:141)
       ... 10 more

any idea what went wromg? I'm using Java 1.5 BTW, which is supported as
far as the readme says
Roedy Green - 27 Sep 2005 22:57 GMT
>any idea what went wromg? I'm using Java 1.5 BTW, which is supported as
>far as the readme says

Do you have to install cryptix-jce-20050328-snap.zip Cryptix JCE as
well?

Are you running an example literally? Even the tiniest variations
introduce new uncertainty.

you can simplify this by putting the jars in the ext directory. See
http://mindprod.com/jgloss/classpath.html
That can help with tiny typos in the command line.

java -classpath
../cryptix-openpgp-provider.jar:../cryptix-message-api.jar:../cryptix-pki-api.jar:../certpath-api-compat.jar:../bin/cryptix-jce-provider.jar:../bin/cryptix-jce-api.jar:.
cryptix/openpgp/examples/GenerateAndWriteKey

You posted no code. That makes guessing much more difficult.

You are dying on
java.security.Signature.getInstance(Signature.java:208)

I would have expected you to be using getInstance(String algorithm,
Provider provider) or String Provider.

I gather you managed to create a private key ok?

Where did you learn that "PGPDSA" was the appropriate name for the
algorithm?

you might track this down by creating a Provider and getting a list of
the servicess it provides. That should give you the proper names and
let you know what is available.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Ido.Yehieli@gmail.com - 28 Sep 2005 08:28 GMT
Thanks,
   I've managed to solve it myself. it appears my JVM was probably
corrupted - i installed it again and it works now.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.