line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OAuth::Lite2::Signer::Algorithm::HMAC_SHA256; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
39
|
|
4
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
36
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
4
|
use parent 'OAuth::Lite2::Signer::Algorithm'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
7
|
|
7
|
2
|
|
|
2
|
|
872
|
use Digest::SHA; |
|
2
|
|
|
|
|
4485
|
|
|
2
|
|
|
|
|
157
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
1
|
4
|
sub name { "hmac-sha256" } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub hash { |
12
|
4
|
|
|
4
|
1
|
5
|
my ($self, $key, $text) = @_; |
13
|
4
|
|
|
|
|
78
|
Digest::SHA::hmac_sha256($text, $key); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
OAuth::Lite2::Signer::Algorithm::HMAC_SHA256 - hmac-sha256 signature algorithm class |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $algorithm = OAuth::Lite2::Signer::Algorithm::HMAC_SHA256->new; |
23
|
|
|
|
|
|
|
my $signature = $algorithm->hash($key, $text); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
DEPRECATED. 'hmac-sha256' 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-sha256'. |
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
|
|
|
|
|
|
|
1; |