blib/lib/Crypt/Perl/PKCS10/Attribute/challengePassword.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 28 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
_encode_params
2.0
BEGIN
2.0
CRAP 2.0
1 package Crypt::Perl::PKCS10::Attribute::challengePassword;
2  
3 =encoding utf-8
4  
5 =head1 NAME
6  
7 Crypt::Perl::PKCS10::Attribute::challengePassword
8  
9 =head1 SYNOPSIS
10  
11 my $chpw = Crypt::Perl::PKCS10::Attribute::challengePassword->new($passwd);
12  
13 =head1 SECURITY
14  
15 This attribute stores a phrase B<UNENCRYPTED> in the CSR. Don’t put
16 anything in here that you consider sensitive!
17  
18 It’s likely that you don’t need this attribute.
19 Check with your Certificate Authority to find out for sure sure if
20 you need to include this in your CSR.
21  
22 =head1 DESCRIPTION
23  
24 Instances of this class represent a C<challengePassword> attribute of a
25 PKCS #10 Certificate Signing Request (CSR).
26  
27 You probably don’t need to
28 instantiate this class directly; instead, you can instantiate it
29 implicitly by listing out arguments to
30 L<Crypt::Perl::PKCS10>’s constructor. See that module’s
31 L<SYNOPSIS|Crypt::Perl::PKCS10/SYNOPSIS> for an example.
32  
33 =cut
34  
35 use strict;
36 use warnings;
37  
38 use parent qw( Crypt::Perl::PKCS10::Attribute );
39  
40 use constant OID => '1.2.840.113549.1.9.7';
41  
42 use constant ASN1 => <<END;
43 challengePassword ::= CHOICE {
44 password UTF8String
45 }
46 END
47  
48 sub new {
49 my ($class, $passwd) = @_;
50  
51 return bless \$passwd, $class;
52 }
53  
54 sub _encode_params {
55 my ($self) = @_;
56  
57 return {
58 password => "$$self",
59 };
60 }
61  
62 1;