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

[iaik-ssl] certificateTypes check in getCertificate() with RSAPublicKey i/f



Sometime back, I had received a reply in the IAIK Mailing List indicating something to this effect :
[During Client Authentication for certificateTypes' check within getCertificate() method, we should preferably check :
    if (clientCertChain[i].getPublicKey() instanceof javax.crypto.interfaces.RSAPublicKey)
]
The above test requires that we have javax classes.

However, javax.crypto.interfaces.RSAPublicKey is not available in any of these jar files (2.5 versions) :
    iaik_ssl.jar
    iaik_jce.jar (it however, contains javax.crypto.interfaces.DHPublicKey)
    rsa_rc4.jar (it however, contains iaik.security.rsa.RSAPublicKey).

So, I am rather forced to go by my old logic :
    if ( (clientCertChain[i].getPublicKey().getAlgorithm()).equalsIgnoreCase("RSA") )

I would welcome comments to better this logic. (In fact I liked the logic of checking if it's an instance of RSAPublicKey !)

Thanks in advance.

Sundar Krishnan