How can I extract the --embedded-filename for scripting?

Peter Lebbing peter at digitalbrains.com
Wed May 8 13:36:12 CEST 2013


Maybe I didn't read your message well enough before I answered. You said you
couldn't use standard out. This is a crude way to get the status-fd stuff in a
file as you mention:

$ gpg --status-fd 3 --use-embedded-filename foo.gpg 3>foo.status
You need a passphrase to unlock the secret key for
user: [...]
2048-bit RSA key, ID [...]

gpg:encrypted with 2048-bit RSA key, ID [...]

$ cat foo-status
[GNUPG:] ENC_TO [...] 1 0
[GNUPG:] USERID_HINT [...]
[GNUPG:] NEED_PASSPHRASE [...] [...] 1 0
[GNUPG:] GOOD_PASSPHRASE
[GNUPG:] BEGIN_DECRYPTION
[GNUPG:] DECRYPTION_INFO 2 9
[GNUPG:] PLAINTEXT 62 1368012643 Hi%20Michael
[GNUPG:] PLAINTEXT_LENGTH 16
[GNUPG:] DECRYPTION_OKAY
[GNUPG:] GOODMDC
[GNUPG:] END_DECRYPTION

Since my own key is on a smartcard, I couldn't use it to test the "ask for
password on the console" thing, so I used a test key which I don't want to
reveal as it's a spam honeypot key.

Bash scripting can do much nicer things with fd's than just throwing the output
in a file. By the way, you never mentioned the platform you're working on.

HTH,

Peter.

-- 
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <http://digitalbrains.com/2012/openpgp-key-peter>



More information about the Gnupg-users mailing list