1Crypt::RSA::ErrorhandleUrs(e3r)Contributed Perl DocumentCartyipotn::RSA::Errorhandler(3)
2
3
4

NAME

6       Crypt::RSA::Errorhandler - Error handling mechanism for Crypt::RSA.
7

SYNOPSIS

9           package Foo;
10
11           use Crypt::RSA::Errorhandler;
12           @ISA = qw(Crypt::RSA::Errorhandler);
13
14           sub alive {
15               ..
16               ..
17               return
18               $self->error ("Awake, awake! Ring the alarum bell. \
19                              Murther and treason!", $dagger)
20                   if $self->murdered($king);
21           }
22
23           package main;
24
25           use Foo;
26           my $foo = new Foo;
27           $foo->alive($king) or print $foo->errstr();
28               # prints "Awake, awake! ... "
29

DESCRIPTION

31       Crypt::RSA::Errorhandler encapsulates the error handling mechanism used
32       by the modules in Crypt::RSA bundle. Crypt::RSA::Errorhandler doesn't
33       have a constructor and is meant to be inherited. The derived modules
34       use its two methods, error() and errstr(), to communicate error mes‐
35       sages to the caller.
36
37       When a method of the derived module fails, it calls $self->error() and
38       returns undef to the caller. The error message passed to error() is
39       made available to the caller through the errstr() accessor. error()
40       also accepts a list of sensitive data that it wipes out (undef'es)
41       before returning.
42
43       The caller should never call errstr() to check for errors. errstr()
44       should be called only when a method indicates (usually through an undef
45       return value) that an error has occured. This is because errstr() is
46       never overwritten and will always contain a value after the occurance
47       of first error.
48

METHODS

50       new()
51           Barebones constructor.
52
53       error($mesage, ($wipeme, $wipemetoo))
54           The first argument to error() is $message which is placed in $self-
55           >{errstr} and the remaining arguments are interpretted as variables
56           containing sensitive data that are wiped out from the memory.
57           error() always returns undef.
58
59       errstr()
60           errstr() is an accessor method for $self->{errstr}.
61
62       errstrrst()
63           This method sets $self->{errstr} to an empty string.
64

AUTHOR

66       Vipul Ved Prakash, <mail@vipul.net>
67

SEE ALSO

69       Crypt::RSA(3)
70
71
72
73perl v5.8.8                       2007-04-17       Crypt::RSA::Errorhandler(3)
Impressum