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.

Convert Object to byte[] in Java Card

JavaCard Applet Development Related Questions and Answers.
aahmadzadeh
Posts: 27
Joined: Mon Sep 28, 2015 2:31 am
Points :400
Contact:

Convert Object to byte[] in Java Card

Post by aahmadzadeh » Wed Oct 07, 2015 11:32 am

I am using Java Card 2.1.1 and JCDK 2.1.2

How can i convert an Object (an instance of PublicKey) to byte[] and vise versa in Java Card applets?

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

Re: Convert Object to byte[] in Java Card

Post by UNKNwYSHSA » Mon Oct 12, 2015 2:19 am

aahmadzadeh wrote:I am using Java Card 2.1.1 and JCDK 2.1.2

How can i convert an Object (an instance of PublicKey) to byte[] and vise versa in Java Card applets?


Do you need the function like Serializable interface?

You can use the getXXX() method to convert PublicKey to byte[];
And use the setXXX() method to convert byte[] to PublicKey;
Here's the getXXX/setXXX method PublicKey support:
1 DSAPublicKey: getY/setY;
2 ECPublicKey: getW/setW;
3 RSAPublicKey: getExponent/setExponent and getModulus/setModulus;
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 46 guests

JavaCard OS : Disclaimer