I have a java map in which there are no applets. when I try to add / change keys with JCManager , I get 6A84and 6A88APDU-Response.
Note 1: I was looking for GP Card Spec2.2 for both of these answers, and finally I did not find anything but their meaning!
Note 2: When I change the key set number to 2, and set the switch to add, I get 6A80 [Invalid parameters in the command data field] !!!
Note 3: Then I could add and change the keys successfully. In addition, after removing the card from the reader and re-entering it, there were no changes in the card keys! but after some attempts to add and change, I get 6A80 / 6A84 / 6A88
This is the output of jcmanager, while I set the switch to “Add”, which gives me 6A84 [Not enough space in the file] :

And when I see the “Change” switch, I get 6A88 [Related data or reference data not found] :

Update: I use GPSHELL to replace / replace keys, but I get this output:
C:\Users\ghasemi\Desktop\GPShell-1.4.4>gpshell recyclekey-cosmo-gp211.txt
mode_211
enable_trace
establish_context
card_connect
select -AID a0000000030000
Command --> 00A4040007A0000000030000
Wrapped command --> 00A4040007A0000000030000
Response <-- 6F108408A000000003000000A5049F6501FF9000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 505152535455565758595a5b5c5d5e5
f -enc_key 505152535455565758595a5b5c5d5e5f -kek_key 505152535455565758595a5b5c5
d5e5f // Open secure channel
Command --> 80CA006600
Wrapped command --> 80CA006600
Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012
A026E01029000
Command --> 8050000008EFBC3082C086980800
Wrapped command --> 8050000008EFBC3082C086980800
Response <-- 0000116001007F8B0AF9020201CE4DA5AC97B74B861FCDC3513F4E279000
mutual_authentication() returns 0x80302000 (The verification of the card cryptog
ram failed.)
C:\Users\ghasemi\Desktop\GPShell-1.4.4>gpshell replacekey-cosmo-gp211.txt
mode_211
enable_trace
establish_context
card_connect
select -AID a0000000030000
Command --> 00A4040007A0000000030000
Wrapped command --> 00A4040007A0000000030000
Response <-- 6F108408A000000003000000A5049F6501FF9000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
f -enc_key 404142434445464748494a4b4c4d4e4f -kek_key 404142434445464748494a4b4c4
d4e4f // Open secure channel
Command --> 80CA006600
Wrapped command --> 80CA006600
Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012
A026E01029000
Command --> 8050000008265AB6AEA30BA66700
Wrapped command --> 8050000008265AB6AEA30BA66700
Response <-- 0000116001007F8B0AF9020201CE4DA5AC97B74BC8B179AE19AE9C799000
Command --> 848201001038FCE51496D47D400D437EC5F7D51EFE
Wrapped command --> 848201001038FCE51496D47D400D437EC5F7D51EFE
Response <-- 9000
put_sc_key -keyver 1 -newkeyver 1 -mac_key 505152535455565758595a5b5c5d5e5f -enc
_key 505152535455565758595a5b5c5d5e5f -kek_key 505152535455565758595a5b5c5d5e5f
// Put secure channel keys
Command --> 80D8018143018010AA3EB3DDC7861B08DA195E1CA04A8BDF03A4B7D68010AA3EB3DD
C7861B08DA195E1CA04A8BDF03A4B7D68010AA3EB3DDC7861B08DA195E1CA04A8BDF03A4B7D600
Wrapped command --> 84D801814B018010AA3EB3DDC7861B08DA195E1CA04A8BDF03A4B7D68010
AA3EB3DDC7861B08DA195E1CA04A8BDF03A4B7D68010AA3EB3DDC7861B08DA195E1CA04A8BDF03A4
B7D602CA7DE4B07AD3DE00
Response <-- 6A88
put_secure_channel_keys() returns 0x80206A88 (6A88: Referenced data not found.)
C:\Users\ghasemi\Desktop\GPShell-1.4.4>
this is the contents of recyclekey-cosmo-gp211.txt [gpshell script]:
mode_211
enable_trace
establish_context
card_connect
select -AID a0000000030000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 505152535455565758595a5b5c5d5e5f -enc_key 505152535455565758595a5b5c5d5e5f -kek_key 505152535455565758595a5b5c5d5e5f // Open secure channel
put_sc_key -keyver 1 -newkeyver 1 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f -kek_key 404142434445464748494a4b4c4d4e4f // Put secure channel keys
card_disconnect
release_context
and this is the contents of replacekey-cosmo-gp211.txt [gpshell script]:
mode_211
enable_trace
establish_context
card_connect
select -AID a0000000030000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f -kek_key 404142434445464748494a4b4c4d4e4f // Open secure channel
put_sc_key -keyver 1 -newkeyver 1 -mac_key 505152535455565758595a5b5c5d5e5f -enc_key 505152535455565758595a5b5c5d5e5f -kek_key 505152535455565758595a5b5c5d5e5f // Put secure channel keys
card_disconnect
release_context
Update 2:

How can I deal with this problem?