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

I

Ido.Yehieli

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
 
R

Roedy Green

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.
 
I

Ido.Yehieli

Thanks,
I've managed to solve it myself. it appears my JVM was probably
corrupted - i installed it again and it works now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top