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