line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OAuth::Lite2::Signer::Algorithm; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
615
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
40
|
|
4
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
158
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
1
|
11
|
sub new { bless {}, $_[0] } |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub name { |
9
|
0
|
|
|
0
|
1
|
|
die "abstract method"; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub hash { |
13
|
0
|
|
|
0
|
1
|
|
my ($self, $key, $text) = @_; |
14
|
0
|
|
|
|
|
|
die "abstract method"; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
OAuth::Lite2::Signer::Algorithm - signature algorithm base class. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Imlement child class inheriting this. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
package OAuth::Lite2::Signer::Algorithm::Foo; |
26
|
|
|
|
|
|
|
use parent 'OAuth::Lite2::Signer::Algorithm'; |
27
|
|
|
|
|
|
|
sub hash { |
28
|
|
|
|
|
|
|
# override |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
And use with 'hash' method interface. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $algorithm = OAuth::Lite2::Signer::Algorithm::Foo->new; |
35
|
|
|
|
|
|
|
my $signature = $algorithm->hash($key, $text); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 DESCRIPTION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
DEPRECATED. signature algorithm base class. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 METHODS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 new( ) |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Constructor. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 name |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Returns a name of the algorithm. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 hash( $key, $text ) |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Generate signature. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $signature = $algorithm->hash($key, $text); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SEE ALSO |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
L |
61
|
|
|
|
|
|
|
L |
62
|
|
|
|
|
|
|
L |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Lyo Kato, Elyo.kato@gmail.comE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Copyright (C) 2010 by Lyo Kato |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
73
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
74
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |