Кирилл Мещеряков пишет:Можно форматировать и в Windows, через панель управления.
Для pcscd в этом случае никакой разницы не будет.
OpenSC форматирование необходимо только в случае, если Вы собираетесь использовать OpenSC объекты и интерфейсы.
Не, в Windows не наш метод :)
В общем пропатчил я OpenSC и похоже форматирование получилось успешным. По крайней мере токен при нём начал мигать.
[root@localhost etc]# pkcs15-init --erase-card
[pkcs15-init] ctx.c:735:sc_context_create: ===================================
[pkcs15-init] ctx.c:736:sc_context_create: opensc version: 0.11.13
[pkcs15-init] reader-openct.c:79:openct_reader_init: called
[pkcs15-init] reader-pcsc.c:879:pcsc_detect_readers: Probing pcsc readers
[pkcs15-init] reader-pcsc.c:901:pcsc_detect_readers: Establish pcsc context
[pkcs15-init] reader-pcsc.c:896:pcsc_detect_readers: SCardListReaders failed: 0x8010002e
[pkcs15-init] reader-pcsc.c:1015:pcsc_detect_readers: returning with: No readers found
[pkcs15-init] sc.c:196:sc_detect_card_presence: called
[pkcs15-init] reader-openct.c:194:openct_reader_detect_card_presence: called
[pkcs15-init] sc.c:201:sc_detect_card_presence: returning with: 1
Using reader with a card: CCID Compatible
[pkcs15-init] sc.c:196:sc_detect_card_presence: called
[pkcs15-init] reader-openct.c:194:openct_reader_detect_card_presence: called
[pkcs15-init] sc.c:201:sc_detect_card_presence: returning with: 1
[pkcs15-init] card.c:110:sc_connect_card: called
[pkcs15-init] reader-openct.c:218:openct_reader_connect: called
[pkcs15-init] card-gemsafeV1.c:120:gemsafe_match_card: called
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] card-piv.c:1761:piv_match_card: called
[pkcs15-init] card-piv.c:493:piv_find_aid: called
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Function not supported
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Function not supported
[pkcs15-init] card-piv.c:576:piv_find_aid: returning with: -1208
[pkcs15-init] card-entersafe.c:101:entersafe_match_card: called
[pkcs15-init] card-rutoken.c:120:rutoken_match_card: called
[pkcs15-init] card-rutoken.c:126:rutoken_match_card: returning with: 0
[pkcs15-init] card-rtecp.c:53:rtecp_match_card: returning with: 1
[pkcs15-init] card.c:221:sc_connect_card: card info: Rutoken ECP card, 0, 0x0
[pkcs15-init] card.c:222:sc_connect_card: returning with: 0
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] card.c:675:sc_card_ctl: card_ctl(4) not supported
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0050154946
[pkcs15-init] iso7816.c:99:iso7816_check_sw: File not found
[pkcs15-init] card-rtecp.c:306:rtecp_select_file: : File not found
[pkcs15-init] card.c:554:sc_select_file: returning with: -1201
[pkcs15-init] profile.c:306:sc_profile_load: Using profile directory '/usr/share/opensc'.
[pkcs15-init] profile.c:306:sc_profile_load: Using profile directory '/usr/share/opensc'.
[pkcs15-init] pkcs15.c:700:sc_pkcs15_bind: called
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f002f00
[pkcs15-init] iso7816.c:99:iso7816_check_sw: File not found
[pkcs15-init] card-rtecp.c:306:rtecp_select_file: : File not found
[pkcs15-init] card.c:554:sc_select_file: returning with: -1201
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f005015
[pkcs15-init] iso7816.c:99:iso7816_check_sw: File not found
[pkcs15-init] card.c:554:sc_select_file: returning with: -1201
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f005031
[pkcs15-init] iso7816.c:99:iso7816_check_sw: File not found
[pkcs15-init] card-rtecp.c:306:rtecp_select_file: : File not found
[pkcs15-init] card.c:554:sc_select_file: returning with: -1201
[pkcs15-init] pkcs15.c:593:sc_pkcs15_bind_internal: EF(ODF) not found in '3f005031'
[pkcs15-init] pkcs15-syn.c:107:sc_pkcs15_bind_synthetic: called
[pkcs15-init] pkcs15-syn.c:148:sc_pkcs15_bind_synthetic: no emulator list in config file, trying all builtin emulators
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying westcos
[pkcs15-init] p15emu-westcos.c:244:sc_pkcs15emu_westcos_init_ex: sc_pkcs15_init_func_ex westcos
[pkcs15-init] p15emu-westcos.c:231:westcos_detect_card: westcos_detect_card (Rutoken ECP card)
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying openpgp
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying infocamere
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying starcert
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying tcos
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying esteid
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying postecert
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying PIV-II
[pkcs15-init] pkcs15-piv.c:521:sc_pkcs15emu_piv_init_ex: called
[pkcs15-init] pkcs15-piv.c:100:piv_detect_card: called
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying gemsafeGPK
[pkcs15-init] pkcs15-gemsafeGPK.c:515:sc_pkcs15emu_gemsafeGPK_init_ex: Entering sc_pkcs15emu_gemsafeGPK_init_ex
[pkcs15-init] pkcs15-gemsafeGPK.c:163:gemsafe_detect_card: called
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying gemsafeV1
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying actalis
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying atrust-acos
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying tccardos
[pkcs15-init] pkcs15-syn.c:150:sc_pkcs15_bind_synthetic: trying entersafe
[pkcs15-init] pkcs15-esinit.c:77:sc_pkcs15emu_entersafe_init_ex: called
[pkcs15-init] pkcs15-esinit.c:33:entersafe_detect_card: called
[pkcs15-init] pkcs15-syn.c:159:sc_pkcs15_bind_synthetic: searching for 'emulate foo { ... }' blocks
[pkcs15-init] pkcs15.c:799:sc_pkcs15_bind: returning with: -1413
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] card.c:236:sc_disconnect_card: called
[pkcs15-init] reader-openct.c:265:openct_reader_disconnect: called
[pkcs15-init] card.c:251:sc_disconnect_card: returning with: 0
[pkcs15-init] ctx.c:765:sc_release_context: called
[pkcs15-init] reader-openct.c:168:openct_reader_release: called
[pkcs15-init] reader-openct.c:168:openct_reader_release: called
[pkcs15-init] reader-openct.c:154:openct_reader_finish: called
[root@localhost etc]#
Но тут нарисовалась новая проблема, ошибка при создании сертификата
<span class="codeStyle">[root@localhost etc]# pkcs15-init --create-pkcs15 --so-pin "87654321" --so-puk ""
[pkcs15-init] ctx.c:735:sc_context_create: ===================================
[pkcs15-init] ctx.c:736:sc_context_create: opensc version: 0.11.13
[pkcs15-init] reader-openct.c:79:openct_reader_init: called
[pkcs15-init] reader-pcsc.c:879:pcsc_detect_readers: Probing pcsc readers
[pkcs15-init] reader-pcsc.c:901:pcsc_detect_readers: Establish pcsc context
[pkcs15-init] reader-pcsc.c:896:pcsc_detect_readers: SCardListReaders failed: 0x8010002e
[pkcs15-init] reader-pcsc.c:1015:pcsc_detect_readers: returning with: No readers found
[pkcs15-init] sc.c:196:sc_detect_card_presence: called
[pkcs15-init] reader-openct.c:194:openct_reader_detect_card_presence: called
[pkcs15-init] sc.c:201:sc_detect_card_presence: returning with: 1
Using reader with a card: CCID Compatible
[pkcs15-init] sc.c:196:sc_detect_card_presence: called
[pkcs15-init] reader-openct.c:194:openct_reader_detect_card_presence: called
[pkcs15-init] sc.c:201:sc_detect_card_presence: returning with: 1
[pkcs15-init] card.c:110:sc_connect_card: called
[pkcs15-init] reader-openct.c:218:openct_reader_connect: called
[pkcs15-init] card-gemsafeV1.c:120:gemsafe_match_card: called
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] card-piv.c:1761:piv_match_card: called
[pkcs15-init] card-piv.c:493:piv_find_aid: called
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Function not supported
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Function not supported
[pkcs15-init] card-piv.c:576:piv_find_aid: returning with: -1208
[pkcs15-init] card-entersafe.c:101:entersafe_match_card: called
[pkcs15-init] card-rutoken.c:120:rutoken_match_card: called
[pkcs15-init] card-rutoken.c:126:rutoken_match_card: returning with: 0
[pkcs15-init] card-rtecp.c:53:rtecp_match_card: returning with: 1
[pkcs15-init] card.c:221:sc_connect_card: card info: Rutoken ECP card, 0, 0x0
[pkcs15-init] card.c:222:sc_connect_card: returning with: 0
[pkcs15-init] reader-openct.c:410:openct_reader_lock: called
[pkcs15-init] card.c:675:sc_card_ctl: card_ctl(4) not supported
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0050154946
[pkcs15-init] iso7816.c:99:iso7816_check_sw: File not found
[pkcs15-init] card-rtecp.c:306:rtecp_select_file: : File not found
[pkcs15-init] card.c:554:sc_select_file: returning with: -1201
[pkcs15-init] profile.c:306:sc_profile_load: Using profile directory '/usr/share/opensc'.
[pkcs15-init] profile.c:306:sc_profile_load: Using profile directory '/usr/share/opensc'.
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f002f00, size=128
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f00
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f001000, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f001000
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f0010001000, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006001, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006002, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006003, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006004, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f0010001000
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f00100010006005, size=0
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] card.c:532:sc_select_file: called; type=2, path=3f00
[pkcs15-init] card.c:554:sc_select_file: returning with: 0
[pkcs15-init] card.c:362:sc_create_file: called; type=2, path=3f005000, size=5000
[pkcs15-init] card.c:367:sc_create_file: returning with: 0
[pkcs15-init] pkcs15-rtecp.c:171:rtecp_create_pin: called
[pkcs15-init] card.c:362:sc_create_file: called; type=0, path=, size=8
[pkcs15-init] iso7816.c:99:iso7816_check_sw: Incorrect parameters in the data field
[pkcs15-init] card-rtecp.c:564:rtecp_create_file: returning with: Incorrect parameters in APDU
[pkcs15-init] card.c:367:sc_create_file: returning with: Incorrect parameters in APDU
[pkcs15-init] pkcs15-rtecp.c:209:rtecp_create_pin: returning with: Incorrect parameters in APDU
Failed to create PKCS #15 meta structure: Incorrect parameters in APDU
[pkcs15-init] reader-openct.c:437:openct_reader_unlock: called
[pkcs15-init] card.c:236:sc_disconnect_card: called
[pkcs15-init] reader-openct.c:265:openct_reader_disconnect: called
[pkcs15-init] card.c:251:sc_disconnect_card: returning with: 0
[pkcs15-init] ctx.c:765:sc_release_context: called
[pkcs15-init] reader-openct.c:168:openct_reader_release: called
[pkcs15-init] reader-openct.c:168:openct_reader_release: called
[pkcs15-init] reader-openct.c:154:openct_reader_finish: called
[root@localhost etc]#
</span>