DBIx::...penPGP(3pm)
๐ DBIx::Class::EncodedColumn::Crypt::OpenPGP โ the perl v5.40.1 era, User Contributed Perl Documentation vibe ๐
okay bestie, sit down, hydrate, because we're about to make your database columns keep a secret ๐โจ
โจ NAME โจ
DBIx::Class::EncodedColumn::Crypt::OpenPGP โ literally just: encrypt your columns using Crypt::OpenPGP. that's the whole job. iconique. ๐
๐ SYNOPSIS ๐
here's the vibe, no notes:
__PACKAGE__->add_columns(
'secret_data' => {
data_type => 'TEXT',
encode_column => 1,
encode_class => 'Crypt::OpenPGP',
encode_args => {
recipient => '7BEF6294',
},
encode_check_method => 'decrypt_data',
};
my $row = $schema->resultset('EncryptedClass')
->create({ secret_data => 'This is secret' });
is(
$row->decrypt_data('Private Key Passphrase'),
'This is secret',
'PGP/GPG Encryption works!'
);
see how clean that is?? you write it, it goes in encrypted, and you call decrypt_data with the passphrase to get your little secret back. ๐ฆ
๐ธ DESCRIPTION ๐ธ
so this module is a conduit to working with Crypt::OpenPGP, so that you can encrypt data in your database using gpg. periodt. ๐
right now it only handles encrypting โ that's it, that's the feature set. but it may add signing of columns in the future. manifesting it for us, lowkey. ๐ฎโจ
๐ CONFIGURATION ๐
in the column definition, you specify the encode_args hash exactly like the synopsis shows. now here's the tea:
- the
recipientis required if you're doing key exchange encryption ๐ - or, if you want to use symmetric key encryption with a passphrase, you can specify a
passphraseoption instead:
encode_args => { passphrase => "Shared Secret" }
that's it. shared secret. mutual. bestie behavior. ๐ซถ
๐ pgp_args, aka the custom keyring section ๐
if you have a separate path to your public and private key ring file, or if you have alternative Crypt::OpenPGP configuration, you can pass the constructor args through the pgp_args configuration key:
encode_args => {
pgp_args => {
SecRing => "$FindBin::Bin/var/secring.gpg",
PubRing => "$FindBin::Bin/var/pubring.gpg",
}
}
look at that. SecRing, PubRing, all the paths, all the vibes. ๐ง
๐ a lil homework, bestie ๐
the included tests cover good usage, and it is advised to briefly browse through them. yes, actually read the tests. they're giving documentation. they ate. ๐ฅ
โ ๏ธ also, remember to keep your private keys secure! like, fr fr. do not be out here leaking your private key to the group chat. that is not main character energy, that is a security incident. ๐ญ๐
๐ AUTHOR ๐
J. Shirley <cpan@coldhardcode.com> ๐
๐ LICENSE ๐
this library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. slay. open source royalty. โญ
and that's the whole page, bestie!! ๐โจ this was DBIx::...penPGP(3pm) from the User Contributed Perl Documentation, and the footer said perl v5.40.1 dated 2025-04-01 โ so go forth, encrypt those columns, guard those keys, and have the most secure little day ever. ๐๐ฆ๐
๐ฆ where this page comes from
- debian trixie: libdbix-class-encodedcolumn-perl 0.00020-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdbix-class-encodedcolumn-perl 0.00020-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdbix-class-encodedcolumn-perl 0.00020-3 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms