when calling the function
public KeyGenerationParameters getKeyGenerationParameters(SecureRandom rnd) from the class ECKeyImpl with an uninitialized Key, the function
getDefaultKeyGenerationParameters(type, size, rnd) gets called
in the called function
getDefaultKeyGenerationParameters(byte algorithm, short keySize, SecureRandom rnd) {
byte keyType = algorithm == KeyPair.ALG_EC_FP ? KeyBuilder.TYPE_EC_FP_PUBLIC : KeyBuilder.TYPE_EC_F2M_PUBLIC;
From petermah...@gmail.com on October 01, 2013 21:36:13
when calling the function public KeyGenerationParameters getKeyGenerationParameters(SecureRandom rnd) from the class ECKeyImpl with an uninitialized Key, the function
getDefaultKeyGenerationParameters(type, size, rnd) gets called
where type is a constant from the keyBuilder ( http://www.win.tue.nl/pinpasjc/docs/apis/jc222/constant-values.html#javacard.security.KeyBuilder.TYPE_EC_FP_PRIVATE ).
in the called function getDefaultKeyGenerationParameters(byte algorithm, short keySize, SecureRandom rnd) { byte keyType = algorithm == KeyPair.ALG_EC_FP ? KeyBuilder.TYPE_EC_FP_PUBLIC : KeyBuilder.TYPE_EC_F2M_PUBLIC;
this type variable gets compared to constants from the KeyPair class ( http://www.win.tue.nl/pinpasjc/docs/apis/jc222/constant-values.html#javacard.security.KeyPair.ALG_EC_FP )
directly calling getDefaultsDomainParameters() from getKeyGenerationParameters() would solve the problem.
Original issue: http://code.google.com/p/jcardsim/issues/detail?id=22