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