File: PGP.pm

package info (click to toggle)
libdbix-class-encodedcolumn-perl 0.00020-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 236 kB
  • sloc: perl: 616; sql: 48; makefile: 2
file content (82 lines) | stat: -rw-r--r-- 1,903 bytes parent folder | download | duplicates (4)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package # hide from PAUSE
  DigestTest::Schema::PGP;

use strict;
use warnings;
use base qw/DBIx::Class/;
use Dir::Self;
use File::Spec;

my $pgp_conf = {
  SecRing => File::Spec->catdir(__DIR__,'secring.gpg'),
  PubRing => File::Spec->catdir(__DIR__,'pubring.gpg'),
};

__PACKAGE__->load_components(qw/EncodedColumn Core/);
__PACKAGE__->table('test_pgp');
__PACKAGE__->add_columns(
  id => {
    data_type => 'int',
    is_nullable => 0,
    is_auto_increment => 1
  },
  dummy_col => {
    data_type => 'char',
    size      => 43,
    encode_column => 0,
    encode_class  => 'Digest',
    encode_check_method => 'check_dummy_col',
  },
  pgp_col_passphrase => {
    data_type => 'text',
    is_nullable => 1,
    encode_column => 1,
    encode_class  => 'Crypt::OpenPGP',
    encode_args => {
      passphrase => 'Secret Words',
      armour     => 1
    },
    encode_check_method => 'decrypt_pgp_passphrase',
  },
  pgp_col_key => {
    data_type => 'text',
    is_nullable => 1,
    encode_column => 1,
    encode_class  => 'Crypt::OpenPGP',
    encode_args => {
      recipient => '1B8924AA',
      pgp_args   => $pgp_conf,
      armour     => 1
    },
    encode_check_method => 'decrypt_pgp_key',
  },
  pgp_col_key_ps => {
    data_type => 'text',
    is_nullable => 1,
    encode_column => 1,
    encode_class  => 'Crypt::OpenPGP',
    encode_args => {
      recipient => '7BEF6294',
      pgp_args   => $pgp_conf,
      armour     => 1
    },
    encode_check_method => 'decrypt_pgp_key_ps',
  },
  pgp_col_rijndael256 => {
    data_type => 'text',
    is_nullable => 1,
    encode_column => 1,
    encode_class  => 'Crypt::OpenPGP',
    encode_args => {
      passphrase => 'Secret Words',
      armour     => 1,
      pgp_args   => $pgp_conf,
      cipher     => 'Rijndael256',
    },
    encode_check_method => 'decrypt_pgp_rijndael256',
  },
);

__PACKAGE__->set_primary_key('id');

1;