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

Discussion in 'Java' started by Ido.Yehieli@gmail.com, Sep 27, 2005.

  1. Guest

    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
    , Sep 27, 2005
    #1
    1. Advertising

  2. Roedy Green Guest

    On 27 Sep 2005 02:06:23 -0700, wrote or quoted :

    >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.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
    Roedy Green, Sep 27, 2005
    #2
    1. Advertising

  3. Guest

    Thanks,
    I've managed to solve it myself. it appears my JVM was probably
    corrupted - i installed it again and it works now.
    , Sep 28, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JJBW
    Replies:
    1
    Views:
    10,123
    Joerg Jooss
    Apr 24, 2004
  2. ml1n
    Replies:
    0
    Views:
    345
  3. Gustavo Narea
    Replies:
    14
    Views:
    860
    Gustavo Narea
    Feb 16, 2009
  4. Decrypt DSA signature

    , Jul 14, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    678
  5. Bing Du Test

    Crypt::OpenPGP memory use

    Bing Du Test, Jul 7, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    100
    Bing Du Test
    Jul 7, 2003
Loading...

Share This Page