7 passphrase => 'recipient',
8 'trust-model' => 'always',
12 RT->Config->Get('Crypt')->{'AllowEncryptDataInDB'} = 1;
14 RT::Test->import_gnupg_key('general@example.com', 'public');
15 RT::Test->import_gnupg_key('general@example.com', 'secret');
16 my $queue = RT::Test->load_or_create_queue(
18 CorrespondAddress => 'general@example.com',
20 ok $queue && $queue->id, 'loaded or created queue';
23 my $ticket = RT::Test->create_ticket(
29 my $txn = $ticket->Transactions->First;
30 ok $txn && $txn->id, 'found first transaction';
31 is $txn->Type, 'Create', 'it is Create transaction';
33 my $attach = $txn->Attachments->First;
34 ok $attach && $attach->id, 'found attachment';
35 is $attach->Content, 'test', 'correct content';
37 my ($status, $msg) = $attach->Encrypt;
38 ok $status, 'encrypted attachment';
40 isnt $attach->Content, 'test', 'correct content';
42 ($status, $msg) = $attach->Decrypt;
43 ok $status, 'decrypted attachment';
45 is $attach->Content, 'test', 'correct content';