Annotation of src/usr.bin/signify/signify.1, Revision 1.47
1.47 ! tedu 1: .\" $OpenBSD: signify.1,v 1.46 2019/03/23 07:10:06 tedu Exp $
1.1 tedu 2: .\"
3: .\"Copyright (c) 2013 Marc Espie <espie@openbsd.org>
4: .\"Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
5: .\"
6: .\"Permission to use, copy, modify, and distribute this software for any
7: .\"purpose with or without fee is hereby granted, provided that the above
8: .\"copyright notice and this permission notice appear in all copies.
9: .\"
10: .\"THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11: .\"WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12: .\"MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13: .\"ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14: .\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15: .\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16: .\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1.47 ! tedu 17: .Dd $Mdocdate: March 23 2019 $
1.1 tedu 18: .Dt SIGNIFY 1
19: .Os
20: .Sh NAME
21: .Nm signify
22: .Nd cryptographically sign and verify files
23: .Sh SYNOPSIS
24: .Nm signify
1.24 tedu 25: .Fl C
26: .Op Fl q
27: .Fl p Ar pubkey
28: .Fl x Ar sigfile
1.25 naddy 29: .Op Ar
1.24 tedu 30: .Nm signify
1.10 deraadt 31: .Fl G
1.25 naddy 32: .Op Fl n
1.15 deraadt 33: .Op Fl c Ar comment
1.7 espie 34: .Fl p Ar pubkey
35: .Fl s Ar seckey
36: .Nm signify
1.10 deraadt 37: .Fl S
1.46 tedu 38: .Op Fl enz
1.19 tedu 39: .Op Fl x Ar sigfile
1.7 espie 40: .Fl s Ar seckey
1.19 tedu 41: .Fl m Ar message
1.7 espie 42: .Nm signify
1.10 deraadt 43: .Fl V
1.35 espie 44: .Op Fl eqz
45: .Op Fl p Ar pubkey
46: .Op Fl t Ar keytype
1.19 tedu 47: .Op Fl x Ar sigfile
48: .Fl m Ar message
1.1 tedu 49: .Sh DESCRIPTION
50: The
51: .Nm
1.19 tedu 52: utility creates and verifies cryptographic signatures.
53: A signature verifies the integrity of a
1.8 tedu 54: .Ar message .
1.10 deraadt 55: The mode of operation is selected with the following options:
1.12 tedu 56: .Bl -tag -width Dsssigfile
1.24 tedu 57: .It Fl C
1.25 naddy 58: Verify a signed checksum list, and then verify the checksum for
1.24 tedu 59: each file.
60: If no files are specified, all of them are checked.
61: .Ar sigfile
62: should be the signed output of
63: .Xr sha256 1 .
1.10 deraadt 64: .It Fl G
1.25 naddy 65: Generate a new key pair.
1.40 tedu 66: Keynames should follow the convention of
67: .Pa keyname.pub
68: and
69: .Pa keyname.sec
70: for the public and secret keys, respectively.
1.10 deraadt 71: .It Fl S
1.19 tedu 72: Sign the specified message file and create a signature.
1.10 deraadt 73: .It Fl V
1.19 tedu 74: Verify the message and signature match.
1.10 deraadt 75: .El
1.4 jmc 76: .Pp
1.10 deraadt 77: The other options are as follows:
1.12 tedu 78: .Bl -tag -width Dsssignature
1.14 tedu 79: .It Fl c Ar comment
80: Specify the comment to be added during key generation.
1.8 tedu 81: .It Fl e
1.19 tedu 82: When signing, embed the message after the signature.
83: When verifying, extract the message from the signature.
84: (This requires that the signature was created using
85: .Fl e
86: and creates a new message file as output.)
87: .It Fl m Ar message
88: When signing, the file containing the message to sign.
89: When verifying, the file containing the message to verify.
90: When verifying with
91: .Fl e ,
92: the file to create.
1.6 tedu 93: .It Fl n
1.46 tedu 94: When generating a key pair, do not ask for a passphrase.
1.1 tedu 95: Otherwise,
96: .Nm
1.19 tedu 97: will prompt the user for a passphrase to protect the secret key.
1.46 tedu 98: When signing with
99: .Fl z ,
100: store a zero time stamp in the
101: .Xr gzip 1
102: header.
1.6 tedu 103: .It Fl p Ar pubkey
1.1 tedu 104: Public key produced by
1.7 espie 105: .Fl G ,
1.1 tedu 106: and used by
1.7 espie 107: .Fl V
1.1 tedu 108: to check a signature.
1.24 tedu 109: .It Fl q
1.25 naddy 110: Quiet mode.
111: Suppress informational output.
1.6 tedu 112: .It Fl s Ar seckey
1.1 tedu 113: Secret (private) key produced by
1.7 espie 114: .Fl G ,
1.1 tedu 115: and used by
1.7 espie 116: .Fl S
1.1 tedu 117: to sign a message.
1.35 espie 118: .It Fl t Ar keytype
119: When deducing the correct key to check a signature, make sure
120: the actual key matches
1.39 tedu 121: .Pa /etc/signify/*-keytype.pub .
1.19 tedu 122: .It Fl x Ar sigfile
123: The signature file to create or verify.
124: The default is
125: .Ar message Ns .sig .
1.35 espie 126: .It Fl z
127: Sign and verify
128: .Xr gzip 1
129: archives, where the signing data
130: is embedded in the
131: .Xr gzip 1
132: header.
1.1 tedu 133: .El
1.4 jmc 134: .Pp
135: The key and signature files created by
136: .Nm
137: have the same format.
138: The first line of the file is a free form text comment that may be edited,
139: so long as it does not exceed a single line.
1.40 tedu 140: Signature comments will be generated based on the name of the secret
141: key used for signing.
142: This comment can then be used as a hint for the name of the public key
143: when verifying.
1.4 jmc 144: The second line of the file is the actual key or signature base64 encoded.
1.1 tedu 145: .Sh EXIT STATUS
1.4 jmc 146: .Ex -std signify
147: It may fail because of one of the following reasons:
148: .Pp
1.1 tedu 149: .Bl -bullet -compact
1.4 jmc 150: .It
1.1 tedu 151: Some necessary files do not exist.
152: .It
153: Entered passphrase is incorrect.
154: .It
155: The message file was corrupted and its signature does not match.
156: .It
157: The message file is too large.
158: .El
159: .Sh EXAMPLES
1.25 naddy 160: Create a new key pair:
1.7 espie 161: .Dl $ signify -G -p newkey.pub -s newkey.sec
1.4 jmc 162: .Pp
163: Sign a file, specifying a signature name:
1.19 tedu 164: .Dl $ signify -S -s key.sec -m message.txt -x msg.sig
1.4 jmc 165: .Pp
1.1 tedu 166: Verify a signature, using the default signature name:
1.19 tedu 167: .Dl $ signify -V -p key.pub -m generalsorders.txt
1.11 deraadt 168: .Pp
1.17 deraadt 169: Verify a release directory containing
1.19 tedu 170: .Pa SHA256.sig
1.17 deraadt 171: and a full set of release files:
1.21 jmc 172: .Bd -literal -offset indent -compact
1.45 deraadt 173: $ signify -C -p /etc/signify/openbsd-66-base.pub -x SHA256.sig
1.22 lteo 174: .Ed
175: .Pp
176: Verify a bsd.rd before an upgrade:
177: .Bd -literal -offset indent -compact
1.45 deraadt 178: $ signify -C -p /etc/signify/openbsd-66-base.pub -x SHA256.sig bsd.rd
1.21 jmc 179: .Ed
1.35 espie 180: .Pp
181: Sign a gzip archive:
182: .Bd -literal -offset indent -compact
183: $ signify -Sz -s key-arc.sec -m in.tgz -x out.tgz
184: .Ed
185: .Pp
186: Verify a gzip pipeline:
187: .Bd -literal -offset indent -compact
1.38 tedu 188: $ ftp url | signify -Vz -t arc | tar ztf -
1.35 espie 189: .Ed
1.1 tedu 190: .Sh SEE ALSO
1.11 deraadt 191: .Xr fw_update 1 ,
1.36 espie 192: .Xr gzip 1 ,
1.11 deraadt 193: .Xr pkg_add 1 ,
1.47 ! tedu 194: .Xr sha256 1 ,
! 195: .Xr sysupgrade 8
1.1 tedu 196: .Sh HISTORY
197: The
198: .Nm
199: command first appeared in
1.7 espie 200: .Ox 5.5 .
1.30 tedu 201: .Sh AUTHORS
1.36 espie 202: .An -nosplit
203: .An Ted Unangst Aq Mt tedu@openbsd.org
204: and
1.37 jmc 205: .An Marc Espie Aq Mt espie@openbsd.org .