Can I use JavaCard framework 2.2 In version 1, the ‘alg’ in the ‘signature’ class is used_ HMAC_ SHA1 ‘method?

I want to use JavaCard security. ALG in signature class_ HMAC_ SHA1 method But my JavaCard Framework version is 2.2 1. Therefore, the signature class does not contain this method of this version

Solution

You can always use only in 2.2 Constant alg found in frame 2_ HMAC_ SHA1 (= (byte) 24) and pass it to signature Getinstance() method Therefore, using this value is not a problem However, the smart card hardware running applet needs to support this algorithm

Therefore, if your smart card hardware supports JC 2.2 1, the value alg is used_ HMAC_ SHA1 calling getinstance() method will usually result in cryptoexception (cryptoexception. No_such_algorithm) with reason, indicating that the algorithm is not supported and JC 2.2 1 does not support any HMAC algorithm) Direct use of public constants may result in upload or installation failures

To be clear here, I'm not saying that compiling for different framework versions may suddenly solve your problem I'd rather suggest that you can't simply upgrade the features available on the card

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>