line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OAuth::SignatureMethod::HMAC_SHA1; |
2
|
7
|
|
|
7
|
|
44
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
476
|
|
3
|
7
|
|
|
7
|
|
41
|
use strict; |
|
7
|
|
|
|
|
335
|
|
|
7
|
|
|
|
|
483
|
|
4
|
7
|
|
|
7
|
|
8747
|
use Digest::HMAC_SHA1; |
|
7
|
|
|
|
|
66057
|
|
|
7
|
|
|
|
|
317
|
|
5
|
7
|
|
|
7
|
|
6701
|
use MIME::Base64; |
|
7
|
|
|
|
|
5899
|
|
|
7
|
|
|
|
|
1334
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub sign { |
8
|
21
|
|
|
21
|
0
|
139
|
my $self = shift; |
9
|
21
|
|
|
|
|
34
|
my $request = shift; |
10
|
21
|
|
|
|
|
127
|
my $hmac = Digest::HMAC_SHA1->new($request->signature_key); |
11
|
21
|
|
|
|
|
2182
|
$hmac->add($request->signature_base_string); |
12
|
21
|
|
|
|
|
2062
|
return encode_base64($hmac->digest, ''); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub verify { |
16
|
12
|
|
|
12
|
0
|
22
|
my $self = shift; |
17
|
12
|
|
|
|
|
20
|
my $request = shift; |
18
|
12
|
|
|
|
|
66
|
return $request->signature eq $self->sign($request); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 NAME |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Net::OAuth::SignatureMethod::HMAC_SHA1 - HMAC_SHA1 Signature Method for OAuth protocol |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 SEE ALSO |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
L, L |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 AUTHOR |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Keith Grennan, C<< >> |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Copyright 2007 Keith Grennan, all rights reserved. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
38
|
|
|
|
|
|
|
under the same terms as Perl itself. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |