[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-ssl] DH key and NullPointerException



Dieter Bratko wrote:

> Hello,
>
> [...]
> However, since ExtractKeys tool expects a version of iSaSiLk (2) no more
> available for downlaod, I attach a new version of ExtractKeys that can be
> run with the most recent version of iSaSiLk 3.
>
> Regards,
> Dieter Bratko
>

Thank you.
I run this new ExtractKeys program with my certificate file, and it
created the file PublicKeyStore.java containing public RSA key
from that certificate. Great.

But I still have two problems:

1) Your demo applet contains the following code:
SSLClientContext context = new SSLClientContext(

(RSAPublicKey)PublicKeyStore.getPublicKey("RSA"),

(DHPublicKey)PublicKeyStore.getPublicKey("DH"));

However, the generated PublicKeyStore.java file creates only RSA key:

public static PublicKey getPublicKey(String algorithm) {
    if( algorithm.equals("RSA") ) return new RSAPublicKey(modulus, exponent);
//    if( algorithm.equals("DH") ) return new DHPublicKey(y, p, g);
    return null;
}

How can I extract a DH key? And do I have to do it? RSA key is not enough?

2) When I run my test applet, I get the following exception in
SSLConnection.startHandshake():

java.lang.NullPointerException
 at iaik.applet.ssl.Random.nextByte(Random)
 at iaik.applet.ssl.Random.nextBytes(Random, Compiled Code)
 at iaik.applet.ssl.ClientHello.<init>(ClientHello)
 at iaik.applet.ssl.ClientHandshaker.sendHandshakeMessages(ClientHandshaker)
 at iaik.applet.ssl.ClientHandshaker.doHandshake(ClientHandshaker)
 at iaik.applet.ssl.SSLConnection.startHandshake(SSLConnection)
 at com.test.Test$SendButtonAction.actionPerformed(Test.java:75)
 [...]

What can be the reason for this exception?
Can it be wrong RSA key? or lack of DH key?
My SSL server uses the same certificate, which I had used to extract public RSA
key from.


--
Best regards,
Alex Ratner



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-ssl/sslthreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-ssl