Hello ,
I've done many javacard programs using this method :
_compilation with javacard kit 2.2.1
_convertion into ".cap" with the javacard kit 2.1.2
All this programs work fine with this method : helloworld, read, write in
the card, ....
But when i want to use the crypto api, i can't charge the program in the
card (just by adding 2 lines for generating keys):
----------> returns 0x80206A80 (6A80: Wrong data / Incorrect values i data.)
I think it's because i use the 2.1.2 version , but if i use the 2.2.1 to
convert , it's another error and no program work with this method.....even
helloworld doesn't work...
-----------> returns 0x80206985 (6985: Command not allowed - Conditions of
use not satisfied.)
I thing i must change my gpshel command , but i have read many forums but
can't find the configuration for my card cyberflex 32k, some people had
similar problems so they used the kit 2.1.2 combined with 2.2.1 like me, but
i think they can't use the crypto api with this.........
here are the scripts for compiling , converting and installing the cardlet
in the card :
------------------------------------------------------------------------------------------------------------------------
echo Compilation...
echo $JC22_API
$JAVA_HOME/bin/javac -source 1.2 -target 1.2 -g -classpath $JC22_API -d
$OUT/$PROJECT/ $SRC/$PROJECT/$PKGAPPLET/$APPLET.java
echo $APPLET.class compiled: OK
echo .
echo Converting...
$JAVA_HOME/bin/java -classpath
$JC22_HOME/lib/converter.jar:$JC22_HOME/lib/offcardverifier.jar
com.sun.javacard.converter.Converter -nobanner -classdir $OUT/$PROJECT/
-exportpath $JC_EXP -d $OUT/$PROJECT/ -out EXP JCA CAP -applet $AIDAPPLET
$PKGAPPLET.$APPLET $PKGAPPLET $AIDPACKAGE $PKGVERSION
echo $APPLET.cap converted: OK
echo .
cp $OUT/$PROJECT/$PKGAPPLET/javacard/$PKGAPPLET.cap $OUT/$PROJECT/
echo Scripting...
$JAVA_HOME/bin/java -classpath $JC22_HOME/lib/scriptgen.jar
com.sun.javacard.scriptgen.Main -nobanner -o $OUT/$PROJECT/$APPLET.scr
$OUT/$PROJECT/$PKGAPPLET/javacard/$PKGAPPLET.cap
echo $APPLET.scr created: OK
echo .
echo Completing script...
cat $MISC/Header.scr $OUT/$PROJECT/$APPLET.scr $MISC/Install.scr
$MISC/Footer.scr > $OUT/$PROJECT/$SIMUSCRIPT.scr
rm -f $OUT/$PROJECT/$APPLET.scr
echo $SIMUSCRIPT.scr created: OK
-------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------
echo establish_context >> $OUT/config.txt
echo card_connect >> $OUT/config.txt
echo select -AID $CARDSECURITYDOMAIN2 >> $OUT/config.txt
echo open_sc -security 3 -keyind 0 -keyver 0 -mac_key $CARDKEY -enc_key
$CARDKEY >> $OUT/config.txt
echo install_for_load -pkgAID $PACKAGEAID -nvCodeLimit 500 >>
$OUT/config.txt
echo load -file $OUT/$PROJECT/$PKGAPPLET/javacard/$PKGAPPLET.cap.transf >>
$OUT/config.txt
echo install_for_install -instParam 00 -priv 02 -AID $APPLETAID -pkgAID
$PACKAGEAID -instAID $APPLETAID -nvDataLimit 500 >> $OUT/config.txt
echo card_disconnect >> $OUT/config.txt
echo release_context >> $OUT/config.txt
-------------------------------------------------------------------------------------------------------------------------------------------------
the variable $JC_EXP is the directory
"java_card_kit-2_1_2/api21_export_files" or
"java_card_kit-2_2_/api_export_files" with the the first directory it works
well but the second doesn't work , while charging the applet in the card :
-------------------> returns 0x80206985 (6985: Command not allowed -
Conditions of use not satisfied.)
Any help will be apreciated,
kind regards
Franck
--
View this message in context:
http://www.nabble.com/How-to-use-the-crypto-api-with-a-card-gemalto-cyberflex-32k---tp22626105p22626105.html
Sent from the MuscleCard mailing list archive at Nabble.com.
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle