JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

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 :3055
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: Google [Bot] and 33 guests

JavaCard OS : Disclaimer