summaryrefslogtreecommitdiffstats
path: root/lib/KiokuDB/Serializer/JSON/Crypt.pm
blob: 8a87fa54fcab3821696d09bf1479f911e2eb34aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package KiokuDB::Serializer::JSON::Crypt;
use Moose;
use namespace::autoclean;
# ABSTRACT: encrypted JSON serializer

=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';
with 'KiokuDB::Serializer::Crypt';

__PACKAGE__->meta->make_immutable;

1;