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

How to save the key in RAM?

JavaCard Applet Development Related Questions and Answers.
Elisadl
Posts: 10
Joined: Tue Jan 26, 2016 11:08 pm
Points :119
Contact:

How to save the key in RAM?

Post by Elisadl » Tue Mar 15, 2016 5:51 am

I am trying to use two AESKeys in my Applet for encrypted communication between the card and the host.

Code: Select all

public class MyApplet extends Applet 
{
    private AESKey host_key;
    private AESKey card_key;

    public MyApplet(byte[] bArray, short bOffset, byte bLength)
    {
        host_key = (AESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_AES, KeyBuilder.LENGTH_AES_256, false);
        card_key = (AESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_AES, KeyBuilder.LENGTH_AES_256, false);

        register(bArray, (short) (bOffset + 1), bArray[bOffset]);
    }
}


After some un-encrypted communication and changing some data for key-building, the card builds the keys and sets them:

Code: Select all

host_key.setKey(key_block, (short)0);
card_key.setKey(key_block, (short)32);


But now, the keys are stored in the EEPROM. After a card reset the keys must not be available anymore.
How can I save the key in RAM?

Heather
Posts: 24
Joined: Mon Nov 30, 2015 5:41 am
Points :121
Contact:

Re: How to save the key in RAM?

Post by Heather » Sat Mar 19, 2016 2:34 am

Check here

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: Bing [Bot] and 55 guests

JavaCard OS : Disclaimer