This content has been marked as final. Show 9 replies
No you aren't. You are catching the exception and not even printing it out. So you have no clue why it isn't working.
Never do that.
Print the stack trace and post it here if it still doesn't enlighten you.
What crypto algorithms are supported by your simulator?1 person found this helpful
It's the netbeans JCDK 3.0.2 connected
Added 4096 bit RSA key - #6593240
Added support for transient RSA, EC and DSA private keys - #6270329
Got that on http://www.oracle.com/technetwork/java/javacard/releasenotes-jsp-137685.html
Is the virtual card platform provided with it does not support those keys?
I've looked to the CryptoException...
TheSw = 3
and STATIC NO_SUCH_ALGORITHM = 3
would that mean that there is no RSA algorithm other than 512 bit supported by the emulator?
I guess I'll have to wait on the real card to make bigger keys if that's correct.
Try using KeyPair.ALG_RSA_CRT instead of KeyPair.ALG_RSA.1 person found this helpful
Also, the private key may have to be an RSA CRT Private key, not just an RSA Private key. Just a thought.
Nice try but didn't work. Still have the same error, Key_not_supported.
Thank you for your help!
I'll just wait to get the real card and see if i still have the same problem.
I think it's the virtual environment that makes that mistake... I'll let you know if it works with the card when I receive it.
What you have to do is just share a complete code(as an example) so that we can test it and let you know what is the problem. And from your code i assume that your code is the part of the applet not the host app, if not please mention. As in case of applet you can send back the reason in the catch clause but can't print the whole stack trace.
CREF has some documented limitations (check the developer guide that is in the JCDK). Due to export restrictions, the crypto support is quite limited. You will only be able to use 512 bit keys with CREF. You will need to use a real card or a better emulator (from a card vendor) for this.