pRPC-modules

 view release on metacpan or  search on metacpan

lib/RPC/pClient.pm  view on Meta::CPAN

=item sock

An object of type IO::Socket, which should be connected to the
server.

=item cipher

This attribute can be used to add encryption quite easily. pRPC is not
bound to a certain encryption method, but to a block encryption API. The
attribute is an object supporting the methods I<blocksize>, I<encrypt>
and I<decrypt>. For example, the modules Crypt::DES and Crypt::IDEA
support such an interface.

Note that you can set or remove encryption on the fly (putting C<undef>
as attribute value will stop encryption), but you have to be sure,
that both sides change the encryption mode.

Do B<not> modify this attribute directly, use the I<encrypt> method
instead! However, it is legal to pass the attribute to the constructor.

Example:

    use Crypt::DES;
    $crypt = DES->new(pack("H*", "0123456789abcdef"));
    $client->Encrypt($crypt);

    # or, to stop encryption
    $client->Encrypt(undef);

=item application

=item version

lib/RPC/pServer.pm  view on Meta::CPAN

B<Note:> The latter is not yet functionable, I first need
to work out how to create an object of type IO::socket for
an inetd based server's STDIN and STDOUT. It seems this
is currently not supported by IO::Socket.

=item cipher

This attribute can be used to add encryption quite easily. pRPC is not
bound to a certain encryption method, but to a block encryption API. The
attribute is an object supporting the methods I<blocksize>, I<encrypt>
and I<decrypt>. For example, the modules Crypt::DES and Crypt::IDEA
support such an interface.

Do B<not> modify this attribute directly, use the I<encrypt> method
instead!  However, it is legal to pass the attribute to the constructor.

Example:

    use Crypt::DES;
    $crypt = DES->new(pack("H*", "0123456789abcdef"));
    $client->Encrypt($crypt);

    # or, to stop encryption
    $client->Encrypt(undef);

You might prefer encryption being client dependent, so there is the
additional possibility to setup encryption in the server configuration
file. See L</CONFIGURATION FILE>. Client encryption definitions take
precedence over the I<cipher> attribute.

lib/RPC/pServer.pm  view on Meta::CPAN

=head1 CONFIGURATION FILE

The server configuration file is currently not much more than a
collection of client names or ip numbers that should be permitted
or denied to connect to the server. Any client is represented by
a definition like the following:

        accept .*\.neckar-alb\.de
            encryption    DES
            key           063fde7982defabc
            encryptModule Crypt::DES

        deny .*

In other words a client definition begins with either C<accept pattern>
or C<deny pattern>, followed by some client attributes, each of the
attributes being on a separate line, followed by the attribute value.
The C<pattern> is a perl regular expression matching either the
clients host name or IP number. In particular this means that you
have to escape dots, for example a client with IP number
194.77.118.1 is represented by the pattern C<194\.77\.118\.1>.

lib/RPC/pServer.pm  view on Meta::CPAN

=item encryptionModule

These will be used for creating an encryption object which is used
for communication with the client, see L<Storable(3)> for
details. The object is created with a sequence like

        use $encryptionModule;
        $cipher = $encryption->new(pack("H*", $key));

I<encryptionModule> defaults to I<encryption>, the reason why we need
both is the brain damaged design of the L<Crypt::IDEA> and L<Crypt::DES>
modules, which use different module and package names without any
obvious reason.

=back

You may add any other attribute you want, thus extending your authorization
file. The RPC::pServer module will simply ignore them, but your main
program will find them in the I<client> attribute of the RPC::pServer
object. This can be used for additional client dependent configuration.

t/encrypt.t  view on Meta::CPAN

    #   Force output being written immediately
    $| = 1;

    $@ = '';
    my $cipher = undef;
    eval 'use Crypt::IDEA;'
	. ' $cipher = IDEA->new(pack("H*",'
	. '                          "0123456789abcdef0123456789abcdef"));';
    if (!$cipher) {
        $@ = '';
	eval 'use Crypt::DES;'
	    . ' $cipher = DES->new(pack("H*", "0123456789abcdef"));';
	if (!$cipher) {
	    print "1..0\n";
	    exit 0;
	}
    }

    print "1..14\n";

    $SIG{'PIPE'} = sub { print STDERR "Got signal PIPE.\n"; };

t/noStorableOoEnc.t  view on Meta::CPAN

    #   Force output being written immediately
    $| = 1;

    $@ = '';
    my $cipher = undef;
    eval 'use Crypt::IDEA;'
	. ' $cipher = IDEA->new(pack("H*",'
	. '                          "0123456789abcdef0123456789abcdef"));';
    if (!$cipher) {
        $@ = '';
	eval 'use Crypt::DES;'
	    . ' $cipher = DES->new(pack("H*", "0123456789abcdef"));';
	if (!$cipher) {
	    print "1..0\n";
	    exit 0;
	}
    }

    print "1..14\n";

    $SIG{'PIPE'} = sub { print STDERR "Got signal PIPE.\n"; };



( run in 0.265 second using v1.01-cache-2.11-cpan-9a3d99fc6dc )