@@ -103,22 +103,30 @@ Crypt::OpenSSL::Verify - OpenSSL Verify certificate verification in XS.
103103 use Crypt::OpenSSL::X509;
104104
105105 my $ca = Crypt::OpenSSL::Verify->new(
106- CAfile => 't/cacert.pem',
107- CApath => '/etc/ssl/certs', # Optional
108- noCAfile => 1, # Optional
109- noCApath => 0 # Optional
110- );
111-
112- OR
106+ 't/cacert.pem', # or undef
107+ {
108+ CApath => '/etc/ssl/certs', # Optional
109+ noCAfile => 1, # Optional
110+ noCApath => 0 # Optional
111+ }
112+ );
113113
114114 # Backward compatible with Crypt::OpenSSL:VerifyX509
115115 my $ca = Crypt::OpenSSL::Verify->new('t/cacert.pem');
116116
117- AND
117+ # Using the defaults of your OS:
118+ my $ca = Crypt::OpenSSL::Verify->new();
119+
120+ # and later on..
118121
119122 my $cert = Crypt::OpenSSL::X509->new(...);
120123 $ca->verify($cert);
121124
125+
126+ The object created is similar to running the following command with the
127+ C<openssl verify > command line tool: C<< openssl verify [ -CApath /path/to/certs ]
128+ [ -noCApath ] [ -noCAfile ] [ -CAfile /path/to/file ] cert.pem >>
129+
122130=head1 DESCRIPTION
123131
124132Given a CA certificate and another untrusted certificate, will show
@@ -134,30 +142,28 @@ need to verify that the signing certificate is valid.
134142
135143Constructor. Returns an OpenSSL Verify instance, set up with the given CA.
136144
137- Arguments:
138-
139- * CAfile => $cafile_path - path to a file containing the CA certificate
140- * CApath => $ca_path - path to a directory containg hashed CA Certificates
141- * noCAfile => 0 or 1 - Default CAfile should not be loaded if TRUE
142- * noCApath => 0 or 1 - Default CApath should not be loaded if TRUE
143- * strict_certs => 0 or 1 - Do not override any OpenSSL verify errors
145+ my $ca = Crypt::OpenSSL::Verify->new(
146+ 't/cacert.pem', # or undef
147+ {
148+ # Path to a directory containg hashed CA Certificates
149+ CApath => $ca_path,
144150
145- (
146- CAfile => $cafile_path
147- CApath => '/etc/ssl/certs', # Optional
148- noCAfile => 1, # Optional
149- noCApath => 0, # Optional
150- strict_certs => 1 # Default (Optional)
151- );
151+ # Default CAfile should not be loaded if TRUE, defaults to FALSE
152+ noCAfile => 0,
152153
153- =head2 new('t/cacert.pem');
154+ # Default CApath should not be loaded if TRUE, defaults to FALSE
155+ noCApath => 0,
154156
155- Constructor. Returns an OpenSSL Verify instance, set up with the given CA.
156- Backward compatible with Crypt::OpenSSL:VerifyX509
157+ # Do not override any OpenSSL verify errors if FALSE, defaults to TRUE
158+ strict_certs => 1,
159+ }
160+ );
157161
158- Arguments:
162+ # Backward compatible with Crypt::OpenSSL:VerifyX509
163+ my $ca = Crypt::OpenSSL::Verify->new('t/cacert.pem', {strict_certs => 0 });
159164
160- * $cafile_path - path to a file containing the CA certificate
165+ # Using the defaults of your OS:
166+ my $ca = Crypt::OpenSSL::Verify->new();
161167
162168=head2 new_from_x509($catext)
163169
@@ -211,24 +217,35 @@ Arguements:
211217
212218=head1 AUTHOR
213219
214- Timothy Legge <timlegge@gmail.com>
215- Wesley Schwengle <waterkip>
220+ =over
221+
222+ =item Timothy Legge <timlegge@gmail.com>
223+
224+ =item Wesley Schwengle <waterkip@cpan.org>
225+
226+ =back
216227
217228=head1 COPYRIGHT
218229
219230The following copyright notice applies to all the files provided in
220231this distribution, including binary files, unless explicitly noted
221232otherwise.
222233
223- Copyright 2020 Timothy Legge
224- Copyright 2020 Wesley Schwengle
234+ =over
235+
236+ =item Copyright 2020 Timothy Legge
237+
238+ =item Copyright 2020 Wesley Schwengle
239+
240+ =back
225241
226242Based on the Original Crypt::OpenSSL::VerifyX509 by
227243
228- Copyright 2010 Chris Andrews <chrisandrews@venda.com>
244+ =over
245+
246+ =item Copyright 2010 Chris Andrews <chrisandrews@venda.com>
229247
230- Most of the current module is based on the OpenSSL verify.c app and is
231- therefore under Copyright 1999-2020, OpenSSL Software Foundation.
248+ =back
232249
233250=head1 LICENCE
234251
0 commit comments