Skip to main content

Installing RSA publick key

First, query your public keys on your card :

$ pkcs15-tool --list-public-keys
Using reader with a card: Feitian SCR301 01 00
Public RSA Key [Private Key]
Com. Flags : 2
Usage : [0x4], sign
Access Flags: [0x0]
ModLength : 2048
Key ref : 0
Native : no
Path : 3f0050153000
Auth ID :
ID : c6f280080fb0ed1ebff0480a01d00a98a1b3b89a

In the example, we have one public key with ID c6f280080fb0ed1ebff0480a01d00a98a1b3b89a.

Now, extract and copy the RSA public key to ~/.ssh/authorized_keys to be able to authenticate:

$pkcs15-tool --read-ssh-key c6f280080fb0ed1ebff0480a01d00a98a1b3b89a -o ~/.ssh/authorized_keys
Using reader with a card: Feitian SCR301 01 00
Please enter PIN [User PIN]: