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.

Is it possible to use ALG_HMAC_SHA1 in JC2.2.1?

Algorithm School

Moderator: UNKNwYSHSA

sakkiotto
Posts: 12
Joined: Thu Dec 03, 2015 5:29 am
Points :86
Contact:

Is it possible to use ALG_HMAC_SHA1 in JC2.2.1?

Post by sakkiotto » Tue Dec 15, 2015 4:44 am

My javacard version is JC2.2.1 for which signature class doesn't include ALG_HMAC_SHA1 method. To my best knowledge, it includes this method after JC2.2.2. So is it possible to use this method without upgrading my card JC version?

User avatar
horse dream
Posts: 76
Joined: Thu May 21, 2015 11:48 pm
Points :138
Contact:

Re: Is it possible to use ALG_HMAC_SHA1 in JC2.2.1?

Post by horse dream » Sun Dec 20, 2015 11:32 pm

You could just use the value that you find in the JC2.2.2 version for the constant ALG_HMAC_SHA1 (= (byte)24) and pass it to the Signature.getInstance() method. So using the value is not a problem. However, the smartcard must support this algorithm in order for you to be able to use.

sakkiotto
Posts: 12
Joined: Thu Dec 03, 2015 5:29 am
Points :86
Contact:

Re: Is it possible to use ALG_HMAC_SHA1 in JC2.2.1?

Post by sakkiotto » Sun Dec 20, 2015 11:55 pm

horse dream wrote:You could just use the value that you find in the JC2.2.2 version for the constant ALG_HMAC_SHA1 (= (byte)24) and pass it to the Signature.getInstance() method. So using the value is not a problem. However, the smartcard must support this algorithm in order for you to be able to use.


@horse dream , Thanks for your reply. But how do I know whether my smartcard supports it?

User avatar
horse dream
Posts: 76
Joined: Thu May 21, 2015 11:48 pm
Points :138
Contact:

Re: Is it possible to use ALG_HMAC_SHA1 in JC2.2.1?

Post by horse dream » Mon Dec 21, 2015 1:07 am

sakkiotto wrote:@horse dream , Thanks for your reply. But how do I exactly know whether my smartcard supports it?


If your smartcard supports JC 2.2.1, calling the getInstance() method with the value of ALG_HMAC_SHA1 will typically cause a CryptoException with reason (CryptoException.NO_SUCH_ALGORITHM) indicating that the algorithm is not supported.

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

Re: Is it possible to use ALG_HMAC_SHA1 in JC2.2.1?

Post by UNKNwYSHSA » Mon Dec 21, 2015 4:23 am

The specification JC API v222 describes the function: Signature.getInstance(), and the exceptions it throws.
JC222 API Signature.getInstance()
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 15 guests

JavaCard OS : Disclaimer