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

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

I think I may be wrong in my earlier email.
The recommendation was to check for an instance of java.security.interfaces.RSAPublicKey, not  javax.crypto.interfaces.RSAPublicKey. I am sorry for any confusion. So my logic now is :

    // Note that we are using the single "full" |. A double short-ckted || should also be OK.
    if ( (clientCertChain[i].getPublicKey().getAlgorithm()).equalsIgnoreCase("RSA") |
         (clientCertChain[i].getPublicKey() instanceof java.security.interfaces.RSAPublicKey) ) {
             bCertType = true ;
             break ;     // NOT continue here!   break out of for - j loop if we get a match.
     else {
             bCertType = false ;
This works !

My earlier (wrong) email :

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)