« blib/lib/Config/Apple/Profile/Payload/Certificate.pm
↑ Summary
blib/lib/Config/Apple/Profile/Payload/Certificate/PKCS1.pm »
| 1 | # This is the code for Config::Apple::Profile::Payload::Certificate::PEM. | ||
| 2 | # For Copyright, please see the bottom of the file. | ||
| 3 | |||
| 4 | package Config::Apple::Profile::Payload::Certificate::PEM; | ||
| 5 | |||
| 6 | 3 | ▶ | use 5.14.4; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 3 | ▶ | use warnings FATAL => 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 3 | ▶ | use base qw(Config::Apple::Profile::Payload::Certificate); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 3 | our $VERSION = '0.55'; | |
| 12 | |||
| 13 | 3 | ▶ | use Readonly; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 3 | ▶ | use Config::Apple::Profile::Targets qw(:all); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | 3 | ▶ | use Config::Apple::Profile::Payload::Certificate; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 3 | ▶ | use Config::Apple::Profile::Payload::Types qw($ProfileNumber $ProfileString); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | |||
| 18 | |||
| 19 | =encoding utf8 | ||
| 20 | |||
| 21 | =head1 NAME | ||
| 22 | |||
| 23 | Config::Apple::Profile::Payload::Certificate::PEM - Certificate payload with | ||
| 24 | a PEM-format certificate. | ||
| 25 | |||
| 26 | =head1 SYNOPSIS | ||
| 27 | |||
| 28 | use Config::Apple::Profile; | ||
| 29 | use Config::Apple::Profile::Payload::Certificate::PEM; | ||
| 30 | |||
| 31 | my $cert = new Config::Apple::Profile::Payload::Certificate::PEM; | ||
| 32 | $cert->payload->{PayloadIdentifier} = 'local.acme.CAcert'; | ||
| 33 | $cert->payload->{PayloadDisplayName} = 'AcmeCorp internal CA'; | ||
| 34 | $cert->payload->{PayloadDescription} = 'The certificate authority used for internal web sites.'; | ||
| 35 | $cert->payload->{PayloadOrganization} = 'Acme, Inc.'; | ||
| 36 | $cert->payload->{PayloadCertificateFileName} = 'acme.crt'; | ||
| 37 | $cert->payload->{PayloadContent} = '.................'; # Long string here | ||
| 38 | |||
| 39 | my $profile = new Config::Apple::Profile; | ||
| 40 | push @{$profile->content}, $cert; | ||
| 41 | |||
| 42 | print $profile->export; | ||
| 43 | |||
| 44 | =head1 DESCRIPTION | ||
| 45 | |||
| 46 | This class implements the PEM type of Certificate payload. | ||
| 47 | |||
| 48 | This payload contains a single certificate, in a PKCS#1 container, | ||
| 49 | PEM-encoded. If you have a file that has "BEGIN CERTIFICATE" | ||
| 50 | in it, you've probably got this type of certificate. | ||
| 51 | |||
| 52 | This payload is used to hold B<only one> certificate. If you have multiple | ||
| 53 | certificates, use multiple payloads. | ||
| 54 | |||
| 55 | |||
| 56 | =head1 PAYLOAD KEYS | ||
| 57 | |||
| 58 | All of the payload keys defined in | ||
| 59 | L<Config::Apple::Profile::Payload::Common::Certificate> are used by this | ||
| 60 | payload. | ||
| 61 | |||
| 62 | This payload has the following additional keys: | ||
| 63 | |||
| 64 | =head2 C<PayloadType> | ||
| 65 | |||
| 66 | This is fixed to the string C<com.apple.security.pem>. | ||
| 67 | |||
| 68 | =head2 C<PayloadVersion> | ||
| 69 | |||
| 70 | This is fixed to the value C<1>. | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | 3 | Readonly our %payloadKeys => ( | |
| 75 | # Bring in the certificate keys... | ||
| 76 | %Config::Apple::Profile::Payload::Certificate::payloadKeys, | ||
| 77 | |||
| 78 | # Since we can't go any deeper, define the type and version! | ||
| 79 | 'PayloadType' => { | ||
| 80 | type => $ProfileString, | ||
| 81 | targets => { | ||
| 82 | $TargetIOS => '5.0', | ||
| 83 | $TargetMACOSX => '10.7', | ||
| 84 | }, | ||
| 85 | value => 'com.apple.security.pem', | ||
| 86 | }, | ||
| 87 | 'PayloadVersion' => { | ||
| 88 | type => $ProfileNumber, | ||
| 89 | targets => { | ||
| 90 | $TargetIOS => '5.0', | ||
| 91 | $TargetMACOSX => '10.7', | ||
| 92 | }, | ||
| 93 | value => 1, | ||
| 94 | }, | ||
| 95 | ); # End of %payloadKeys | ||
| 96 | |||
| 97 | |||
| 98 | |||
| 99 | =head1 ACKNOWLEDGEMENTS | ||
| 100 | |||
| 101 | Refer to L<Config::Apple::Profile> for acknowledgements. | ||
| 102 | |||
| 103 | =head1 AUTHOR | ||
| 104 | |||
| 105 | A. Karl Kornel, C<< <karl at kornel.us> >> | ||
| 106 | |||
| 107 | =head1 COPYRIGHT AND LICENSE | ||
| 108 | |||
| 109 | Copyright © 2014 A. Karl Kornel. | ||
| 110 | |||
| 111 | This program is free software; you can redistribute it and/or modify it | ||
| 112 | under the terms of either: the GNU General Public License as published | ||
| 113 | by the Free Software Foundation; or the Artistic License. | ||
| 114 | |||
| 115 | See L<http://dev.perl.org/licenses/> for more information. | ||
| 116 | |||
| 117 | =cut | ||
| 118 | |||
| 119 | 3 | 1; | |