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
24           package main;
25
26           use Foo;
27           my $foo = new Foo;
28           $foo->alive($king) or print $foo->errstr();
29               # prints "Awake, awake! ... "
30

DESCRIPTION

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

METHODS

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

AUTHOR

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

SEE ALSO

70       Crypt::RSA(3)
71
72
73
74perl v5.34.0                      2022-01-21       Crypt::RSA::Errorhandler(3)
Impressum