| 1 | package OAuth::Lite2::Signer::Algorithm::HMAC_SHA256; | ||
| 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 | ▶ | use parent 'OAuth::Lite2::Signer::Algorithm'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 2 | ▶ | use Digest::SHA; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | sub name { "hmac-sha256" } |
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||
| 10 | |||
| 11 | 4 | ▶ | sub hash { |
|
Subroutine
hash: called CC=1 SCAR=0.0
Pod
documented
| |||
| 12 | 4 | my ($self, $key, $text) = @_; | |
| 13 | 4 | 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<OAuth::Lite2::Signer::Algorithm> | ||
| 48 | L<OAuth::Lite2::Signer::Algorithms> | ||
| 49 | L<OAuth::Lite2::Signer::Algorithm::HMAC_SHA1> | ||
| 50 | |||
| 51 | =head1 AUTHOR | ||
| 52 | |||
| 53 | Lyo Kato, E<lt>lyo.kato@gmail.comE<gt> | ||
| 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 | 2 | 1; | |