How to use GPG2 with Ubikey?

01.09.2020, to see all post click here.

Import the key into gpg2:

$ gpg2 --card-edit
gpg/card> fetch
gpg: key ....: public key "... <...@protonmail.com>" imported 
gpg: Total number processed: 1                                                    
gpg:               imported: 1

This will make gpg2 aware of the key on the card.

Decrypting files:

$ gpg2 --decrypt-files important.tar.gz.gpg

This will ask for pin to the card. I also need to press the sensor on the card.