I have exported a gpg key from linux to Mac. Exporting commands on linux are as follows
gpg --export-secret-keys -a test_01.asc gpg --export -a test_01_pub.asc
Importing commands on Mac are as follows
gpg --import test_01.asc gpg --import test_01_pub.asc
But when decrypting with the imported key,
gpg -d -vvv test_01.gpg
gpg: using character set 'utf-8' gpg: enabled compatibility flags: # off=0 ctb=85 tag=1 hlen=3 plen=268 :pubkey enc packet: version 3, algo 1, keyid XXXXXXXXXXXXXXXX data: [2048 bits] gpg: public key is XXXXXXXXXXXXXXXX # off=271 ctb=d2 tag=18 hlen=2 plen=62 new-ctb :encrypted data packet: length: 62 mdc_method: 2 gpg: using subkey XXXXXXXXXXXXXXXX instead of primary key XXXXXXXXXXXXXXXX gpg: encrypted with rsa2048 key, ID XXXXXXXXXXXXXXXX, created xxxx-xx-xx "xxx <firstname.lastname@example.org>" gpg: public key decryption failed: Bad secret key gpg: decryption failed: Bad secret key
And when I tried to change its passwd
gpg -vvv --edit-key XXXXXXXXXXXXXXXX passwd
gpg: key XXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXX: error getting keyinfo from agent: System error w/o errno gpg: key XXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXX: error getting keyinfo from agent: System error w/o errno Key has only stub or on-card key items - no passphrase to change.
The versions of gpgs on Linux and Mac are 2.2.41 and 2.4.0
\r, Linux is
\n... maybe that?