| 1 | package OAuth::Lite2::Signer::Algorithm; | ||
| 2 | |||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 2 | ▶ | sub new { bless {}, $_[0] } |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 7 | |||
| 8 | 0 | ▶ | sub name { |
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 9 | 0 | die "abstract method"; | |
| 10 | } | ||
| 11 | |||
| 12 | 0 | ▶ | sub hash { |
|
Subroutine
hash: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 13 | 0 | 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<OAuth::Lite2::Signer::Algorithms> | ||
| 61 | L<OAuth::Lite2::Signer::Algorithm::HMAC_SHA1> | ||
| 62 | L<OAuth::Lite2::Signer::Algorithm::HMAC_SHA256> | ||
| 63 | |||
| 64 | =head1 AUTHOR | ||
| 65 | |||
| 66 | Lyo Kato, E<lt>lyo.kato@gmail.comE<gt> | ||
| 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 | 2 | 1; | |