Problem with qTESLA package access in Java 9

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with qTESLA package access in Java 9

Fausto Spoto
Hi!

I'm using bouncycastle 1.66 for Java (bcprov-jdk15on-1.66.jar) to create a pair of qTESLA keys and to translate a byte array encoding a qTesla public key into the actual key object. The code is attached.

This works and compiles perfectly in a Java <= 8 environment. However, if I add a module-info.java to my project, hence making it into a Java 9 project, Eclipse complains at:

import org.bouncycastle.pqc.jcajce.provider.qtesla.BCqTESLAPrivateKey;
import org.bouncycastle.pqc.jcajce.provider.qtesla.BCqTESLAPublicKey;

since that package is not exported by the org.bouncycastle.provider module.

I'm not sure why that package is not exported but I suspect that that means that I'm doing something wrong here. Probably I shouldn't use such classes? But then, how do I create public and private qTesla keys?

Fausto


QTESLA_TEST.java (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with qTESLA package access in Java 9

David Hook-3

Yes, you need to use a KeyFactory class to create the keys this way.

See org.bouncycastle.pqc.jcajce.provider.test.QTESLATest for examples of this and key generation.

Regards,

David

On 25/9/20 4:46 am, Fausto Spoto wrote:
Hi!

I'm using bouncycastle 1.66 for Java (bcprov-jdk15on-1.66.jar) to create a pair of qTESLA keys and to translate a byte array encoding a qTesla public key into the actual key object. The code is attached.

This works and compiles perfectly in a Java <= 8 environment. However, if I add a module-info.java to my project, hence making it into a Java 9 project, Eclipse complains at:

import org.bouncycastle.pqc.jcajce.provider.qtesla.BCqTESLAPrivateKey;
import org.bouncycastle.pqc.jcajce.provider.qtesla.BCqTESLAPublicKey;

since that package is not exported by the org.bouncycastle.provider module.

I'm not sure why that package is not exported but I suspect that that means that I'm doing something wrong here. Probably I shouldn't use such classes? But then, how do I create public and private qTesla keys?

Fausto


Reply | Threaded
Open this post in threaded view
|

Re: Problem with qTESLA package access in Java 9

Fausto Spoto
Thank you, it worked flawlessly! Great!

On Fri, Sep 25, 2020 at 4:52 AM David Hook <[hidden email]> wrote:

Yes, you need to use a KeyFactory class to create the keys this way.

See org.bouncycastle.pqc.jcajce.provider.test.QTESLATest for examples of this and key generation.

Regards,

David

On 25/9/20 4:46 am, Fausto Spoto wrote:
Hi!

I'm using bouncycastle 1.66 for Java (bcprov-jdk15on-1.66.jar) to create a pair of qTESLA keys and to translate a byte array encoding a qTesla public key into the actual key object. The code is attached.

This works and compiles perfectly in a Java <= 8 environment. However, if I add a module-info.java to my project, hence making it into a Java 9 project, Eclipse complains at:

import org.bouncycastle.pqc.jcajce.provider.qtesla.BCqTESLAPrivateKey;
import org.bouncycastle.pqc.jcajce.provider.qtesla.BCqTESLAPublicKey;

since that package is not exported by the org.bouncycastle.provider module.

I'm not sure why that package is not exported but I suspect that that means that I'm doing something wrong here. Probably I shouldn't use such classes? But then, how do I create public and private qTesla keys?

Fausto