~ubuntu-branches/ubuntu/gutsy/libgnupg-interface-perl/gutsy

« back to all changes in this revision

Viewing changes to t/encrypt.t

  • Committer: Bazaar Package Importer
  • Author(s): Peter Palfrader
  • Date: 2002-03-31 20:54:51 UTC
  • Revision ID: james.westby@ubuntu.com-20020331205451-ggm3hbo19ff14h1l
Tags: upstream-0.31
ImportĀ upstreamĀ versionĀ 0.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
#
 
3
# $Id: encrypt.t,v 1.4 2001/05/03 06:00:06 ftobin Exp $
 
4
#
 
5
 
 
6
use strict;
 
7
use English;
 
8
 
 
9
use lib './t';
 
10
use MyTest;
 
11
use MyTestSpecific;
 
12
 
 
13
TEST
 
14
{
 
15
    reset_handles();
 
16
    
 
17
    $gnupg->options->clear_recipients();
 
18
    $gnupg->options->clear_meta_recipients_keys();
 
19
    $gnupg->options->push_recipients( '0x2E854A6B' );
 
20
    
 
21
    my $pid = $gnupg->encrypt( handles => $handles );
 
22
    
 
23
    print $stdin @{ $texts{plain}->data() };
 
24
    close $stdin;
 
25
    waitpid $pid, 0;
 
26
    
 
27
    return $CHILD_ERROR == 0;
 
28
};
 
29
 
 
30
 
 
31
TEST
 
32
{
 
33
    reset_handles();
 
34
    
 
35
    my @keys = $gnupg->get_public_keys( '0xF950DA9C' );
 
36
    $gnupg->options->clear_recipients();
 
37
    $gnupg->options->clear_meta_recipients_keys();
 
38
    $gnupg->options->push_meta_recipients_keys( @keys );
 
39
    
 
40
    my $pid = $gnupg->encrypt( handles => $handles );
 
41
    
 
42
    print $stdin @{ $texts{plain}->data() };
 
43
    close $stdin;
 
44
    waitpid $pid,  0;
 
45
    
 
46
    return $CHILD_ERROR == 0;
 
47
};
 
48
 
 
49
 
 
50
TEST
 
51
{
 
52
    reset_handles();
 
53
    
 
54
    $gnupg->options->clear_recipients();
 
55
    $gnupg->options->clear_meta_recipients_keys();
 
56
    $gnupg->options->push_recipients( '0x2E854A6B' );
 
57
    
 
58
    $handles->stdin( $texts{plain}->fh() );
 
59
    $handles->options( 'stdin' )->{direct} = 1;
 
60
    my $pid = $gnupg->encrypt( handles => $handles );
 
61
    
 
62
    waitpid $pid, 0;
 
63
    
 
64
    return $CHILD_ERROR == 0;
 
65
};