File Coverage

blib/lib/Crypt/OpenToken/Cipher/null.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 3 3 100.0
total 18 18 100.0


line stmt bran cond sub pod time code
1             package Crypt::OpenToken::Cipher::null;
2              
3 1     1   8 use Moose;
  1         24  
  1         8  
4 1     1   7858 use Crypt::NULL;
  1         3  
  1         138  
5              
6             with 'Crypt::OpenToken::Cipher';
7              
8 3     3 1 10 sub keysize { 0 }
9 3     3 1 15 sub iv_len { 0 }
10             sub cipher {
11 3     3 1 10 my ($self, $key, $iv) = @_;
12             # its a "NULL" cipher... there's *no* need for a key or an iv...
13 3         16 return Crypt::NULL->new('dummy key');
14             }
15              
16             1;
17              
18             =head1 NAME
19              
20             Crypt::OpenToken::Cipher::null - Null encryption support for OpenToken
21              
22             =head1 DESCRIPTION
23              
24             This library can be used by C<Crypt::OpenToken> to encrypt payloads using
25             NULL encryption.
26              
27             Yes, that's right, "null encryption" (e.g. B<no> encryption of the data
28             whatsoever). Horrible for real-world use, great for interoperability testing.
29              
30             =head1 METHODS
31              
32             =over
33              
34             =item keysize()
35              
36             Returns the key size used for NULL encryption; 0 bytes.
37              
38             =item iv_len()
39              
40             Returns the length of the Initialization Vector needed for NULL encryption; 0
41             bytes.
42              
43             =item cipher($key, $iv)
44              
45             Returns a C<Crypt::CBC> compatible cipher the implements the NULL encryption.
46              
47             =back
48              
49             =head1 AUTHOR
50              
51             Graham TerMarsch (cpan@howlingfrog.com)
52              
53             =head1 COPYRIGHT & LICENSE
54              
55             C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under
56             the Artistic-2.0 license.
57              
58             =head1 SEE ALSO
59              
60             L<Crypt::OpenToken::Cipher>
61              
62             =cut