unable to load private key on the virtual smart card

704 views Asked by At

problem description

I have used bixVirtualReader with OpenSC-isoApplet but I am unable to load private key on the smart card

what I tried

  1. I tried this instruction after creating my 2048/rsa key generating

     pkcs15-init --store-private-key key.pem --auth-id 01 --pin 1234
    

    but it returns following error

    Failed to store private key: Not allowed

    I run this command which says does not have any certificate

     pkcs15-tool -c
    

    Using reader with a card: Bix VIRTUAL_CARD_READER 0

    and also this command which says does not have any key

     pkcs15-tool -k
    

    Using reader with a card: Bix VIRTUAL_CARD_READER 0

  2. I also tried with these commands

     pkcs15-init --create-pkcs15
    
     pkcs15-init --store-certificate publickey.pem --label myKey --auth-id FF --id 01 --format pem --pin 1234
    
     pkcs15-init --generate-key "rsa/2048" --auth-id "FF" --label "myKey" --id "1"
    

    it works but when I run certutil -scinfo it gives the No cert retrieved for reader: Bix VIRTUAL_CARD_READER 0

    please guide me to find the solution how to add valid certificate to my virtual smart card any help appreciated

1

There are 1 answers

0
samini On BEST ANSWER

I enabled key import in the isoApplet DEF_PRIVATE_KEY_IMPORT_ALLOWED = true , and the problem solved