Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

How to unwrap a key on java card

JavaCard Applet Development Related Questions and Answers.
marclo
Posts: 20
Joined: Thu Nov 19, 2015 5:41 am
Points :127
Contact:

How to unwrap a key on java card

Post by marclo » Tue Jan 19, 2016 4:45 am

I have a problem when I do the unwrapping in the off card application. For unwrapping, the private key is needed. And the private key can not leave the java card. So I send the wrapped bytes to the card. But I can't find in javavardx.crypto.Cipher something like UNWRAP_MODE.
How can I use a javacard to unwrap a key?

Here is part of my code in the off card application:

Code: Select all

Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1PADDING", "BC"); 
cipher.init(Cipher.UNWRAP_MODE, privateKey);
SecretKey key = (SecretKey)cipher.unwrap(wrappedKeyBytes, "AES", Cipher.SECRET_KEY);

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: How to unwrap a key on java card

Post by UNKNwYSHSA » Wed Jan 20, 2016 5:39 am

You need to implement the unwrap method in your applet yourself. This method is not supported by the JC api.
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 76 guests

JavaCard OS : Disclaimer