It's our great honour to announce the Industry’s First VHBR CCID reader - VHBR Dual interface smart card reader vR504. It is able to support the world’s fastest ePassports.

To celebrate the new product release, there is Special Discount for New Registered Members in our store.
- Get $20.00 OFF instantly for smart card reader vR504, R502 and bR301

Come to get the readers now!

Difference between KeyBuilder and KeyPair

Algorithm School

Moderator: UNKNwYSHSA

Vlidda
Posts: 15
Joined: Tue Sep 06, 2016 2:59 am
Points: 182
Contact:

Difference between KeyBuilder and KeyPair

Postby Vlidda » Wed Apr 26, 2017 3:17 am

I have doubts about key generation when writing my java card applet. I wonder the difference between KeyBuilder and KeyPair and also the difference between buildKey and KeyPair as well.
And what type of memory is used by the genKeyPair() method, Transient or Persistent ? Many thanks for any help.

chico0609
Posts: 59
Joined: Mon Sep 14, 2015 5:05 am
Points: 412
Contact:

Re: Difference between KeyBuilder and KeyPair

Postby chico0609 » Wed Apr 26, 2017 6:00 am

buildKey is not used to generate a key.

And what type of memory is used by the genKeyPair() method, Transient or Persistent ?


From my understanding, it is common for a smart cards to have RAM dedicated to cryptographic operations. In fact, as much of the operation as possible is done in transient RAM. For key objects, you can specify where the key material is stored. This is specified when you create the key object.

Vlidda
Posts: 15
Joined: Tue Sep 06, 2016 2:59 am
Points: 182
Contact:

Re: Difference between KeyBuilder and KeyPair

Postby Vlidda » Wed Apr 26, 2017 11:15 pm

I used new state to generate RSA keypair object, does it mean that the key objects will be stored in persistent memory?

Code: Select all

KeyPair RSA_KEYP= new KeyPair(KeyPair.ALG_RSA_CRT, (short)1024);
RSA_KEYP.genKeyPair();
rsa_PublicKey = (RSAPublicKey)RSA_KEYP.getPublic();
rsa_PrivateKey=(RSAPrivateCrtKey)RSA_KEYP.getPrivate();               

chico0609
Posts: 59
Joined: Mon Sep 14, 2015 5:05 am
Points: 412
Contact:

Re: Difference between KeyBuilder and KeyPair

Postby chico0609 » Thu Apr 27, 2017 4:12 am

Yes, if you use new statement, the key objects will be stored in persistent memory.

You just need to write once and then you can read many times.


Return to “Algorithm School”

Who is online

Users browsing this forum: No registered users and 3 guests

JavaCard OS : Disclaimer