in reply to Re^4: Unable to get any decrypted output from $gpg->verify
in thread Unable to get any decrypted output from $gpg->verify
Here is an SSCCE showing an encryption/decryption round trip. Just set the three env vars accordingly and run.
#!/usr/bin/env perl use strict; use warnings; use feature 'say'; use Crypt::GPG; my $gpg = Crypt::GPG->new; $gpg->gpgbin ('/usr/bin/gpg'); $gpg->secretkey ($ENV{SECRET_KEY}); $gpg->passphrase ($ENV{GPG_PP}); $gpg->armor (1); my $plaintext = 'PerlMonks Rocks!'; say "Plain text: $plaintext"; my @enctext = $gpg->encrypt ([$plaintext], $ENV{TO_EMAIL}); say "Encrypted text: @enctext"; my $decrypted = $gpg->verify (\@enctext); say "Decrypted text: $decrypted";
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Unable to get any decrypted output from $gpg->verify
by xuo (Acolyte) on Aug 22, 2023 at 18:52 UTC | |
by hippo (Archbishop) on Aug 22, 2023 at 21:08 UTC | |
by xuo (Acolyte) on Aug 23, 2023 at 18:41 UTC | |
by cavac (Prior) on Aug 24, 2023 at 10:36 UTC | |
by xuo (Acolyte) on Aug 24, 2023 at 18:46 UTC | |
|