1 .\" $NetBSD: nbsvtool.1,v 1.4 2008/07/15 12:14:13 wiz Exp $
3 .\" Copyright (c) 2004-2008 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Love Hörnquist Åstrand <lha@it.su.se>
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
34 .Nd create and verify detached signatures of files
38 .Op Fl a Ar anchor-certificates
39 .Op Fl c Ar certificate-chain
40 .Op Fl f Ar certificate-file
41 .Op Fl k Ar private-key-file
42 .Op Fl u Ar required-key-usage
47 is used to create and verify detached X509 signatures of files.
48 Private keys and certificates are expected to be PEM encoded,
49 signatures are in PEM/SMIME format.
50 .\" XXX: pointer to detailed description/documentation of these formats
51 .\" XXX: pointer to concept explanation: key, certificate, signature,
55 .Bl -tag -width Xverify-codeXfileX[signature]XXX
59 placing the signature in
65 are required for this command.
66 .It verify Ar file Op Ar signature
74 .It verify-code Ar file Op Ar signature
75 This is a short cut for verify with the option
81 .Bl -tag -width XfXcertificateXchainXfileXXX
82 .It Fl a Ar anchor-certificates
83 A file containing one or more (concatenated) keys that are considered
85 .It Fl c Ar certificate-chain
86 A file containing additional certificates that will be added to the signature
88 They will be used to fill missing links in the trust chain when
89 verifying the signature.
90 .It Fl f Ar certificate-file
91 A file containing the certificate to use for signing.
92 The certificate must match the key given by
94 .It Fl k Ar private-key-file
95 A file containing the private key to use for signing.
96 .It Fl u Ar required-key-usage
97 Verify that the extended key-usage attribute in the signing certificate
99 .Ar required-key-usage .
100 Otherwise, the signature is rejected.
109 Print verbose information about the signing certificate.
114 Create signature file
118 The private key is found in file
120 the matching certificate is in
122 additional certificates from
124 are included in the created signature.
125 .Dl nbsvtool -k key -f cert -c cert-chain sign hello hello.sp7
127 Verify that the signature
131 and that the signing certificate allows code signing. Certificates
134 are considered trusted, and there must be a certificate chain from one
135 of those certificates to the signing certificate.
136 .Dl nbsvtool -a anchor-file verify-code hello hello.sp7
139 .\" XXX: pointer to X509 documentation, CA setup
141 As there is currently no default trust anchor, you must explicilty
144 otherwise no verification can succeed.