Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

encounted error '6985' '6A88' during installing the .cap file when debugging in JCIDE

I am using JCIDE to debug its sample applet- walletdemo.

I encounted error 6985

conditions not satisfied'and 6A88'Referenced data or reference data not found

during installation of the .cap file on the JCVM when debugging. But I don't know what's wrong and what to do.

The following is part of the applet:

private WalletDemoApplet(byte bArray[], short bOffset, byte bLength)
{
   /* cardid=new byte[MAX_NUM_CARDID];
    key  =new byte[MAX_NUM_KEYS];
    for (byte i = 0; i < MAX_NUM_KEYS; i++)
        key[i] =i;
    for (byte i = 0; i < MAX_NUM_CARDID; i++)
        cardid[i] =i;*/

    balance  = 0;
    integral = 0;


    Key = (DESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES3_2KEY, false);         
    //cipherDES_ECB_NOPAD = Cipher.getInstance(Cipher.ALG_DES_ECB_NOPAD, false);
    cipherDES_ECB_NOPAD = Cipher.getInstance(Cipher.ALG_DES_CBC_ISO9797_M1, false);
    myRandomS = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);

    pin = new OwnerPIN(PIN_TRY_LIMIT,   MAX_PIN_SIZE);
    cardID = new byte[10];
    output = new byte[16];
    //input = new byte[16];
    bRand = false;
    ExternalMark=false;
    verifyMark=false;
    byte iLen = bArray[bOffset]; // aid length
    bOffset = (short) (bOffset+iLen+1);
    byte cLen = bArray[bOffset]; // info length
    bOffset = (short) (bOffset+cLen+1);
    byte aLen = bArray[bOffset]; // applet data length
    bOffset = (short)(bOffset+1);        
    byte pinLen = bArray[bOffset];


    // The installation parameters contain the PIN
    // initialization value
    pin.update(bArray, (short)(bOffset+1), pinLen);

    // Initialize key
    bOffset = (short)(bOffset+pinLen+1);
    byte keyLen = bArray[bOffset];
    Key.setKey(bArray, (short)(bOffset+1));

    // Initialize cardID
    bOffset = (short)(bOffset+keyLen+1);
    byte idLen = bArray[bOffset];
    Util.arrayCopy(bArray, (short)(bOffset+1), cardID, (short)0, (short)idLen); 

    register(); 
}
public static void install(byte[] bArray, short bOffset, byte bLength) {
    // GP-compliant JavaCard applet registration
    new WalletDemoApplet(bArray, bOffset, bLength);

}
like image 374
andy007 Avatar asked Dec 05 '25 11:12

andy007


1 Answers

If the problem is not caused by the algorithm, maybe it's because a installation parameter is required when install.You can try to set the installation parameter, such as “08112233445566778810404142434445464748494A4B4C4D4E4F080010203040506070”.

I hope that i can help you.

like image 74
amethyst Avatar answered Dec 07 '25 23:12

amethyst



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!