]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man/verify.pod
Remainder of SSL purpose and trust code: trust and purpose setting in
[thirdparty/openssl.git] / doc / man / verify.pod
CommitLineData
13938ace
DSH
1=pod
2
3=head1 NAME
4
5pkcs7 - PKCS#7 utility
6
7=head1 SYNOPSIS
8
9B<openssl> B<verify>
10[B<-CApath directory>]
11[B<-CAfile file>]
12[B<-purpose purpose>]
13[B<-untrusted file>]
14[B<-help>]
15[B<-verbose>]
16[B<->]
17[certificates]
18
19
20=head1 DESCRIPTION
21
22The B<verify> command verifies certificate chains.
23
24=head1 COMMAND OPTIONS
25
26=over 4
27
28=item B<-CApath directory>
29
30A directory of trusted certificates. The certificates should have names
31of the form: hash.0 or have symbolic links to them of this
32form ("hash" is the hashed certificate subject name: see the B<-hash> option
33of the B<x509> utility). Under Unix the B<c_rehash> script will automatically
34create symbolic links to a directory of certificates.
35
36=item B<-CAfile file>
37
38A file of trusted certificates. The file should contain multiple certificates
39in PEM format concatenated together.
40
41=item B<-untrusted file>
42
43A file of untrusted certificates. The file should contain multiple certificates
44
45=item B<-purpose purpose>
46
47the intended use for the certificate. Without this option no chain verification
48will be done. Currently accepted uses are B<sslclient>, B<sslserver>,
49B<nssslserver>, B<smimesign>, B<smimeencrypt>. See the B<VERIFY OPERATION>
50section for more information.
51
52=item B<-help>
53
54prints out a usage message.
55
56=item B<-verbose>
57
58print extra information about the operations being performed.
59
60=item B<->
61
62marks the last option. All arguments following this are assumed to be
63certificate files.
64
65
66=item B<certificates>
67
68one or more certificates to verify. If no certificate filenames are included
69then an attempt is made to read a certificate from standard input. They should
70all be in PEM format.
71
72
73=back
74
75=head1 VERIFY OPERATION
76
77The B<verify> program uses the same functions as the internal SSL and S/MIME
78verification, therefore this description applies to these verify operations
79too.
80
81There is one crucial difference between the verify operations performed
82by the B<verify> program: wherever possible an attempt is made to continue
83after an error whereas normally the verify operation would halt on the
84first error. This allows all the problems with a certificate chain to be
85determined.
86
87The verify operation consists of a number of separate steps.
88
89Firstly a certificate chain is built up starting from the supplied certificate
90and ending in the root CA. It is an error if the whole chain cannot be built
91up. The chain is built up by looking up a certificate whose subject name
92matches the issuer name of the current certificate. If a certificate is found
93whose subject and issuer names are identical it is assumed to be the root CA.
94The lookup first looks in the list of untrusted certificates and if no match
95is found the remaining lookups are from the trusted certficates. The root CA
96is always looked up in the trusted certificate list: if the certificate to
97verify is a root certificate then an exact match must be found in the trusted
98list.
99
100The second operation is to check every untrusted certificate's extensions for
101consistency with the supplied purpose. If the B<-purpose> option is not included
102then no checks are done. The supplied or "leaf" certificate must have extensions
103compatible with the supplied purpose and all other certificates must also be valid
104CA certificates. The precise extensions required are described in more detail in
105the B<CERTIFICATE EXTENSIONS> section.
106
107The third operation is to check the trust settings on the root CA. The root
108CA should be trusted for the supplied purpose. For compatability with previous
109versions of SSLeay and OpenSSL a certificate with no trust settings is considered
110to be valid for all purposes.
111
112The final operation is to check the validity of the certificate chain. The validity
113period is checked against the current system time and the notBefore and notAfter
114dates in the certificate. The certificate signatures are also checked at this
115point.
116
117If all operations complete successfully then certificate is considered valid. If
118any operation fails then the certificate is not valid.
119
120=head1 CERTIFICATE EXTENSIONS
121
122...to be added...
123
124=head1 SEE ALSO
125
126x509(1)
127
128=cut