Template::Plugin::GnuPG -- A simple encryption plugin
[% USE GnuPG %] [% FILTER $GnuPG recipient = '0xb56165aa' armor = 1 %] Your new password is 'password'. [% END %]
Template::Plugin::GnuPG provides a simple way to encrypt text through gnupg, using Francis J. Lacoste's GnuPG module. The resulting text is encrypted to the key specified by the recipient parameter to the FILTER.
Template::Plugin::GnuPG
gnupg
GnuPG
recipient
Template::Plugin::GnuPG takes all of the configuration parameters that GnuPG takes; pass constructor parameters as name = value pairs to the USE line, and all other parameters as name = value pairs to the FILTER call:
name = value
USE
FILTER
[% USE GnuPG gnupg_path = '/opt/bin/gpg' trace = 1 %] [% FILTER $GnuPG recipient = "mom@example.com" armor = 1 %] The recipe for Neiman-Marcus cookies is: [% recipe %] [% END %]
The recipient parameter can be a keyid (like 0xB56165AA) or an email address. You can also specify symmetric encryption by passing the symmetric key with a true value (in this case, GnuPG makes you specify a passphrase with the passphrase option).
0xB56165AA
symmetric
passphrase
Output is ASCII armored by default, unless you pass an explicit armor = 0 to the FILTER call:
armor = 0
[% text | $GnuPG symmetric = 1 passphrase = pw armor = 0 %]
Add a reasonable way to sign as well. You can currently sign like so:
[% FILTER $GnuPG recipient = 'foo@example.com' sign = 1 passphrase = pw %]
where pw is the passphrase for your key (the signing key). That's pretty ugly, though; who wants their passphrase in the source templates?
pw
Better documentation
More tests.
Template::Plugin::Filter, GnuPG
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install Template::Plugin::GnuPG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::GnuPG
CPAN shell
perl -MCPAN -e shell install Template::Plugin::GnuPG
For more information on module installation, please visit the detailed CPAN module installation guide.