philipWendland / IsoApplet

A Java Card PKI Applet aiming to be ISO 7816 compliant
GNU General Public License v3.0
167 stars 72 forks source link

Private key import problems #36

Open Lan5alot opened 1 month ago

Lan5alot commented 1 month ago

I've been trying to import a private key to the card, enabling import by setting the "DEF_PRIVATE_KEY_IMPORT_ALLOWED" on the master branch & building it using ant with openjdk-17-jdk-headless but I keep getting "Failed to store private key: Card does not support the requested operation". The command ran is:

pkcs15-init -r "0" -S "key.pem" -a ff -i 01 --pin "777777" -u "digitalSignature,keyEncipherment,dataEncipherment"

I've tried AcosJ 95K, J3H145 and J3R180 cards, but keep getting the same error. I get the feeling I'm missing something, why doesn't this just work, does these cards really all not support private key import?

philipWendland commented 1 week ago

Hi, I just tested the key import and it seems to work for me. Can you provide exact reproduction steps and an OPENSC log? The log might contain sensitive data, your PIN etc.

Did you init the card with pkcs15-init --create-pkcs15?