1*f1fc57f9Ssevan.\" $NetBSD: netpgpverify.1,v 1.13 2018/04/04 21:39:35 sevan Exp $ 241335e2dSagc.\" 332b86961Sagc.\" Copyright (c) 2013,2014,2015 Alistair Crooks <agc@NetBSD.org> 441335e2dSagc.\" All rights reserved. 541335e2dSagc.\" 641335e2dSagc.\" Redistribution and use in source and binary forms, with or without 741335e2dSagc.\" modification, are permitted provided that the following conditions 841335e2dSagc.\" are met: 941335e2dSagc.\" 1. Redistributions of source code must retain the above copyright 1041335e2dSagc.\" notice, this list of conditions and the following disclaimer. 1141335e2dSagc.\" 2. Redistributions in binary form must reproduce the above copyright 1241335e2dSagc.\" notice, this list of conditions and the following disclaimer in the 1341335e2dSagc.\" documentation and/or other materials provided with the distribution. 1441335e2dSagc.\" 1525f78d91Sagc.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1625f78d91Sagc.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1725f78d91Sagc.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1825f78d91Sagc.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1925f78d91Sagc.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2025f78d91Sagc.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2125f78d91Sagc.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2225f78d91Sagc.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2325f78d91Sagc.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2425f78d91Sagc.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2541335e2dSagc.\" 26*f1fc57f9Ssevan.Dd April 3, 2018 2741335e2dSagc.Dt NETPGPVERIFY 1 2841335e2dSagc.Os 2941335e2dSagc.Sh NAME 3041335e2dSagc.Nm netpgpverify 3141335e2dSagc.Nd standalone program for digital signature verification 3241335e2dSagc.Sh SYNOPSIS 3341335e2dSagc.Nm 3425f78d91Sagc.Op Fl v 3525f78d91Sagc.Op Fl S Ar ssh-pub-key-file 3625f78d91Sagc.Op Fl c Ar command 3725f78d91Sagc.Op Fl k Ar keyring 3841335e2dSagc.Ar file ... 3941335e2dSagc.Sh DESCRIPTION 4041335e2dSagcThe 4141335e2dSagc.Nm 4225f78d91Sagcimplements digital signature verification. 4325f78d91SagcIt is designed to be simple and standalone; no external libraries, except 4425f78d91Sagcfor 4532d959bfSagc.Xr libz 4625f78d91Sagcand 4732d959bfSagc.Xr libbz2 4825f78d91Sagcare used, in order to ensure maximum portability. 4941335e2dSagc.Pp 5025f78d91SagcIt is completely rewritten from the version of the program that appeared in 5125f78d91Sagc.Nx 6.0 5225f78d91Sagcas part of the 5325f78d91Sagc.Xr netpgp 1 5425f78d91Sagcsuite of commands. 5525f78d91Sagc.Pp 5625f78d91SagcThe 5741335e2dSagc.Nm 5825f78d91Sagcutility requires a file containing public keys, commonly called a 5925f78d91Sagc.Dq keyring . 6025f78d91SagcDigitally-signed information can be fed to 6141335e2dSagc.Nm 6225f78d91Sagcin two ways: as standard input, or as files provided on the command line. 6325f78d91SagcThe public key part of the key which was used to sign the file must be 6425f78d91Sagcpresent, or the signature verification will fail. 6525f78d91SagcFiles may be signed in two distinct ways: as text documents, and as binary 6625f78d91Sagcfiles. 6725f78d91SagcText documents modify the contents to add different line-ending 6825f78d91Sagccharacters, and behave differently at the final byte of the input document. 6925f78d91SagcBinary files are read verbatim, and are not modified in any way. 7025f78d91Sagc.Pp 7125f78d91SagcThe 7225f78d91Sagc.Fl k 7325f78d91Sagccommand line argument allows a keyring to be specified. 7432b86961Sagc.Pp 7525f78d91SagcThe 7625f78d91Sagc.Fl v 7725f78d91Sagccommand line argument prints the version of the 7825f78d91Sagc.Nm 7925f78d91Sagccommand and then exits. 8032b86961Sagc.Pp 8132b86961SagcThe 8225f78d91Sagc.Fl c 8332b86961Sagcargument allows a 8432b86961Sagc.Dq command 8532b86961Sagcto be given, modifying the behaviour of the 8632b86961Sagc.Nm 8732b86961Sagccommand. 8832b86961SagcThis command can take one of three values: 8925f78d91Sagc.Dq verify 9025f78d91Sagcwhich is also the default, which verifies the signature 9125f78d91Sagcon the data; 9225f78d91Sagc.Dq cat 9325f78d91Sagcwill also verify the signature on the data, and, if 9425f78d91Sagcsuccessfully verified, will display the verified 9525f78d91Sagcdata on 9632b86961Sagc.Dv stdout ; 9732b86961Sagcand 9832b86961Sagc.Dq dump 9932b86961Sagcwhich will dump the individual PGP packets to standard out, along 10032b86961Sagcwith a hexadecimal dump of the first part of the contents of each 10132b86961Sagcpacket. 10232b86961SagcPlease note that the packets from the public key ring will also be dumped 10332b86961Sagcusing this command. 10432b86961SagcThe key ring packets will be displayed immediately before the packets in the 10532b86961Sagcfile being verified. 10632b86961Sagc.Pp 10725f78d91SagcThe 10825f78d91Sagc.Fl S 10925f78d91Sagcargument allows an ssh public key file to be used as the source of 11025f78d91Sagctruth for the key. 11125f78d91SagcThis ssh-key-based signature can be created using the 11225f78d91Sagc.Xr netpgp 1 11325f78d91Sagcutility. 11425f78d91Sagc.Pp 11525f78d91SagcIf a detached signature 11625f78d91Sagc.Dq .sig 11725f78d91Sagcis given on the command line, the signing information will be retrieved 11825f78d91Sagcfrom that file, and the original data is expected to be found in a file in the same 11925f78d91Sagcdirectory with the same name with the 12025f78d91Sagc.Dq .sig 12125f78d91Sagcsuffix removed. 12225f78d91Sagc.Pp 12325f78d91SagcBoth text mode signatures, and binary signatures, can be verified by 12425f78d91Sagc.Nm 12541335e2dSagc.Sh SIGNING AND VERIFICATION 126b2d38cefSagcVerification of a file's signature is best viewed using the following example: 12741335e2dSagc.Bd -literal 12825f78d91Sagc% netpgpverify -k pubring.gpg NetBSD-6.0_RC1_hashes.asc 12925f78d91SagcGood signature for NetBSD-6.0_RC1_hashes.asc made Thu Aug 23 11:47:50 2012 13025f78d91Sagcsignature 4096/RSA (Encrypt or Sign) 064973ac4c4a706e 2009-06-23 13125f78d91Sagcfingerprint ddee 2bdb 9c98 a0d1 d4fb dbf7 0649 73ac 4c4a 706e 13225f78d91Sagcuid NetBSD Security Officer <security-officer@NetBSD.org> 13341335e2dSagc% 13441335e2dSagc.Ed 135c0597ae8Sjoerg.Sh EXIT STATUS 13641335e2dSagcThe 13741335e2dSagc.Nm 13825f78d91Sagcutility will return 0 for a successful verification, 13941335e2dSagc1 if the file's signature does not match what was expected, 14041335e2dSagcor 2 if any other error occurs. 14141335e2dSagc.Sh SEE ALSO 14241335e2dSagc.Xr netpgp 1 , 14341335e2dSagc.\" .Xr libbz2 3 , 14441335e2dSagc.Xr zlib 3 14541335e2dSagc.Sh STANDARDS 1469835dc7aSsevan.Rs 1479835dc7aSsevan.%A J. Callas 1489835dc7aSsevan.%A L. Donnerhacke 1499835dc7aSsevan.%A H. Finney 1509835dc7aSsevan.%A D. Shaw 1519835dc7aSsevan.%A R. Thayer 1529835dc7aSsevan.%D November 2007 1539835dc7aSsevan.%R RFC 4880 1549835dc7aSsevan.%T OpenPGP Message Format 1559835dc7aSsevan.Re 15641335e2dSagc.Sh HISTORY 15741335e2dSagcThe 15841335e2dSagc.Nm 15941335e2dSagccommand first appeared in 16025f78d91Sagc.Nx 7.0 . 16141335e2dSagc.Sh AUTHORS 16225f78d91Sagc.An Alistair Crooks Aq agc@NetBSD.org . 163