From: Maksym T. <mr...@bu...> - 2018-04-19 02:40:33
|
Hi, Is it possible to create SO PIN & PUK codes for already created PKCS15? I have couple of Aventra MyEID v4. During card formatting I didn't set SO PIN & PUK codes. Unfortunately, I can't activate these cards. Since certificates are already imported into cards it would be painfull to erase these cards, reformat and import new certificates. Steps to reproduce (similar to described on https://github.com/OpenSC/OpenSC/wiki/Aventra-MyEID-PKI-card ): $ pkcs15-init --create-pkcs15 --label 'Firstname Lastname' --reader 0 --so-pin '' --so-puk '' --pin '12345678' --puk '87654321' $ pkcs15-init --store-pin --auth-id 01 --label 'nickname' --reader 0 --pin '12345678' --puk '87654321' $ pkcs15-init -F --reader 0 Failed to finalizing card: Not allowed $ pkcs15-tool --reader 0 --dump --list-pins PIN [nickname] Object Flags : [0x3], private, modifiable ID : 01 Flags : [0x30], initialized, needs-padding Length : min_len:4, max_len:8, stored_len:8 Pad char : 0xFF Reference : 1 (0x01) Type : ascii-numeric PKCS#15 Card [Firstname Lastname]: Version : 0 Serial number : 00007169017525987395 Manufacturer ID: Aventra Ltd. Last update : 20180418224042Z Flags : PRN generation, EID compliant PIN [nickname] Object Flags : [0x3], private, modifiable ID : 01 Flags : [0x30], initialized, needs-padding Length : min_len:4, max_len:8, stored_len:8 Pad char : 0xFF Reference : 1 (0x01) Type : ascii-numeric With SO PIN/PUK card activation woks: $ pkcs15-init --create-pkcs15 --label 'Firstname Lastname' --reader 0 --so-pin '11111111' --so-puk '22222222' --pin '12345678' --puk '87654321' $ pkcs15-init --store-pin --auth-id 01 --label 'nickname' --reader 0 --pin '12345678' --puk '87654321' Security officer PIN [Security Officer PIN] required. Please enter Security officer PIN [Security Officer PIN]: $ pkcs15-init -F --reader 0 $ pkcs15-tool --reader 0 --dump --list-pins PIN [Security Officer PIN] Object Flags : [0x3], private, modifiable ID : ff Flags : [0xB0], initialized, needs-padding, soPin Length : min_len:4, max_len:8, stored_len:8 Pad char : 0xFF Reference : 3 (0x03) Type : ascii-numeric PIN [nickname] Object Flags : [0x3], private, modifiable ID : 01 Flags : [0x30], initialized, needs-padding Length : min_len:4, max_len:8, stored_len:8 Pad char : 0xFF Reference : 1 (0x01) Type : ascii-numeric PKCS#15 Card [Firstname Lastname]: Version : 0 Serial number : 00007169017525987395 Manufacturer ID: Aventra Ltd. Last update : 20180418223743Z Flags : PRN generation, EID compliant PIN [Security Officer PIN] Object Flags : [0x3], private, modifiable ID : ff Flags : [0xB0], initialized, needs-padding, soPin Length : min_len:4, max_len:8, stored_len:8 Pad char : 0xFF Reference : 3 (0x03) Type : ascii-numeric PIN [nickname] Object Flags : [0x3], private, modifiable ID : 01 Flags : [0x30], initialized, needs-padding Length : min_len:4, max_len:8, stored_len:8 Pad char : 0xFF Reference : 1 (0x01) Type : ascii-numeric I use Debian Stretch with opensc ver.0.16.0-3 -- WBR, Maksym |