diff options
Diffstat (limited to 'lib/KiokuDB/Serializer/JSON')
-rw-r--r-- | lib/KiokuDB/Serializer/JSON/Crypt.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/KiokuDB/Serializer/JSON/Crypt.pm b/lib/KiokuDB/Serializer/JSON/Crypt.pm index 53569bc..8a87fa5 100644 --- a/lib/KiokuDB/Serializer/JSON/Crypt.pm +++ b/lib/KiokuDB/Serializer/JSON/Crypt.pm @@ -5,8 +5,29 @@ use namespace::autoclean; =head1 SYNOPSIS + use KiokuDB::Util; + use KiokuDB::Serializer::JSON::Crypt; + + my $dsn = '...'; + my $secret = '...'; + + my $backend = KiokuDB::Util::dsn_to_backend( + $dsn, + serializer => KiokuDB::Serializer::JSON::Crypt->new( + crypt_cipher => 'Rijndael', + crypt_mode => 'CFB', + crypt_key => $secret, + ), + ) + + my $d = KiokuDB->new(backend => $backend); + =head1 DESCRIPTION +This serializer class extends L<KiokuDB::Serializer::JSON> to add encryption +support. See L<KiokuDB::Serializer::Crypt> for an explanation of the allowed +attributes. + =cut extends 'KiokuDB::Serializer::JSON'; |