1GnuPG::Handles(3) User Contributed Perl Documentation GnuPG::Handles(3)
2
3
4
6 GnuPG::Handles - GnuPG handles bundle
7
9 use IO::Handle;
10 my ( $stdin, $stdout, $stderr,
11 $status_fh, $logger_fh, $passphrase_fh,
12 )
13 = ( IO::Handle->new(), IO::Handle->new(), IO::Handle->new(),
14 IO::Handle->new(), IO::Handle->new(), IO::Handle->new(),
15 );
16
17 my $handles = GnuPG::Handles->new
18 ( stdin => $stdin,
19 stdout => $stdout,
20 stderr => $stderr,
21 status => $status_fh,
22 logger => $logger_fh,
23 passphrase => $passphrase_fh,
24 );
25
27 GnuPG::Handles objects are generally instantiated to be used in con‐
28 junction with methods of objects of the class GnuPG::Interface.
29 GnuPG::Handles objects represent a collection of handles that are used
30 to communicate with GnuPG.
31
33 Initialization Methods
34
35 new( %initialization_args )
36 This methods creates a new object. The optional arguments are ini‐
37 tialization of data members; the initialization is done in a manner
38 according to the method created as described in "new_hash_init" in
39 Class::MethodMaker.
40
41 hash_init( %args ).
42 This method works as described in "new_hash_init" in Class::Method‐
43 Maker.
44
46 Note that these data members are interacted with via object methods
47 created using the methods described in "get_set" in Class::MethodMaker,
48 or "object" in Class::MethodMaker. Please read there for more informa‐
49 tion.
50
51 stdin
52 This handle is connected to the standard input of a GnuPG process.
53
54 stdout
55 This handle is connected to the standard output of a GnuPG process.
56
57 stderr
58 This handle is connected to the standard error of a GnuPG process.
59
60 status
61 This handle is connected to the status output handle of a GnuPG
62 process.
63
64 logger
65 This handle is connected to the logger output handle of a GnuPG
66 process.
67
68 passphrase
69 This handle is connected to the passphrase input handle of a GnuPG
70 process.
71
72 command
73 This handle is connected to the command input handle of a GnuPG
74 process.
75
76 options
77 This is a hash of hashrefs of settings pertaining to the handles in
78 this object. The outer-level hash is keyed by the names of the
79 handle the setting is for, while the inner is keyed by the setting
80 being referenced. For example, to set the setting "direct" to true
81 for the filehandle "stdin", the following code will do:
82
83 # assuming $handles is an already-created
84 # GnuPG::Handles object, this sets all
85 # options for the filehandle stdin in one blow,
86 # clearing out all others
87 $handles->options( 'stdin', { direct => 1 } );
88
89 # this is useful to just make one change
90 # to the set of options for a handle
91 $handles->options( 'stdin' )->{direct} = 1;
92
93 # and to get the setting...
94 $setting = $handles->options( 'stdin' )->{direct};
95
96 # and to clear the settings for stdin
97 $handles->options( 'stdin', {} );
98
99 The currently-used settings are as follows:
100
101 direct
102 If the setting "direct" is true for a handle, the GnuPG process
103 spawned will access the handle directly. This is useful for
104 having the GnuPG process read or write directly to or from an
105 already-opened file.
106
108 GnuPG::Interface, Class::MethodMaker
109
110
111
112perl v5.8.8 2001-08-21 GnuPG::Handles(3)