1.\" $OpenBSD: keynote.1,v 1.17 2000/09/17 02:11:12 aaron Exp $ 2.\" 3.\" The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) 4.\" 5.\" This code was written by Angelos D. Keromytis in Philadelphia, PA, USA, 6.\" in April-May 1998 7.\" 8.\" Copyright (C) 1998, 1999 by Angelos D. Keromytis. 9.\" 10.\" Permission to use, copy, and modify this software without fee 11.\" is hereby granted, provided that this entire notice is included in 12.\" all copies of any software which is or includes a copy or 13.\" modification of this software. 14.\" You may use this code under the GNU public license if you so wish. Please 15.\" contribute changes back to the author. 16.\" 17.\" THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR 18.\" IMPLIED WARRANTY. IN PARTICULAR, THE AUTHORS MAKES NO 19.\" REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE 20.\" MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR 21.\" PURPOSE. 22.\" 23.Dd April 29, 1999 24.Dt KEYNOTE 1 25.\" .TH keynote 1 local 26.Os 27.Sh NAME 28.Nm keynote 29.Nd command line tool for 30.Xr keynote 3 31operations 32.Sh SYNOPSIS 33.Nm keynote keygen 34.Ar AlgorithmName 35.Ar KeySize 36.Ar PublicKeyFile 37.Ar PrivateKeyFile 38.Op print-offset 39.Op print-length 40 41.Nm keynote sign 42.Op Fl v 43.Ar AlgorithmName 44.Ar AssertionFile 45.Ar PrivateKeyFile 46.Op print-offset 47.Op print-length 48 49.Nm keynote sigver 50.Op AssertionFile 51 52.Nm keynote verify 53.Op Fl h 54.Op Fl e Ar file 55.Fl l Ar file 56.Fl r Ar retlist 57.Op Fl k Ar file 58.Op Fl l Ar file 59.Op Ar file ... 60.Sh DESCRIPTION 61For more details on 62.Nm KeyNote , 63see RFC 2704. 64.Pp 65.Sh KEY GENERATION 66"keynote keygen" creates a public/private key of size 67.Fa KeySize , 68(in bits) for the algorithm specified by 69.Fa AlgorithmName . 70Typical keysizes are 512, 1024, or 2048 (bits). The minimum key size 71for DSA keys is 512 (bits). Supported 72.Fa AlgorithmName 73identifiers are: 74.Bl -tag -width indent 75.It ``dsa-hex:'' 76.It ``dsa-base64:'' 77.It ``rsa-hex:'' 78.It ``rsa-base64:'' 79.It ``x509-hex:'' 80.It ``x509-base64:'' 81.El 82.Pp 83Notice that the trailing colon is required. The resulting public key is 84stored in file 85.Fa PublicKeyFile . 86Similarly, the resulting private key is stored in file 87.Fa PrivateKeyFile . 88Either of the filenames can be specified to be ``-'', in which 89case the corresponding key(s) will be printed in standard output. 90.Pp 91The optional parameters 92.Fa print-offset 93and 94.Fa print-length 95specify the offset from the beginning of the line where the key 96will be printed, and the number of characters of the key that will 97be printed per line. 98.Fa print-length 99includes 100.Fa AlgorithmName 101for the first line and has to be longer (by at least 2) than 102.Fa AlgorithmName . 103.Fa print-length 104also accounts for the line-continuation character (backslash) at 105the end of each line, and the doublequotes at the beginning and end 106of the key encoding. Default values are 12 and 50 respectively. 107.Pp 108.Sh ASSERTION SIGNING 109"keynote sign" reads the assertion contained in 110.Fa AssertionFile 111and generates a signature specified by 112.Fa AlgorithmName 113using the private key stored in 114.Fa PrivateKeyFile . 115The private key is expected to be of the form output by 116"keynote keygen". The private key algorithm and the 117.Fa AlgorithmName 118specified as an argument are expected to match. There is no requirement 119for the internal or ASCII encodings to match. Valid 120.Fa AlgorithmName 121identifiers are: 122.Bl -tag -width indent 123.It ``sig-dsa-sha1-hex:'' 124.It ``sig-dsa-sha1-base64:'' 125.It ``sig-rsa-sha1-hex:'' 126.It ``sig-rsa-sha1-base64:'' 127.It ``sig-rsa-md5-hex:'' 128.It ``sig-rsa-md5-base64:'' 129.It ``sig-x509-sha1-hex:'' 130.It ``sig-x509-sha1-base64:'' 131.El 132.Pp 133Notice that the trailing colon is required. 134The resulting signature is printed in standard output. This can then 135be added (via cut-and-paste or some script) at the end of the 136assertion, in the 137.Fa Signature 138field. 139.Pp 140The public key corresponding to the private key in 141.Fa PrivateKeyFile 142is expected to already be included in the 143.Fa Authorizer 144field of the assertion, either directly or indirectly (i.e., through 145use of a 146.Fa Local-Constants 147attribute). Furthermore, the assertion must have a 148.Fa Signature 149field (even if it is empty), as the signature is computed on 150everything between the 151.Fa KeyNote-Version 152and 153.Fa Signature 154keywords (inclusive), and the 155.Fa AlgorithmName 156string. 157.Pp 158If the 159.Fl v 160flag is provided, "keynote sign" will also verify the newly-created 161signature using the 162.Fa Authorizer 163field key. 164.Pp 165The optional parameters 166.Fa print-offset 167and 168.Fa print-length 169specify the offset from the beginning of the line where the signature 170will be printed, and the number of characters of the signature that will 171be printed per line. 172.Fa print-length 173includes 174.Fa AlgorithmName 175for the first line and has to be longer (by at least 2) than 176.Fa AlgorithmName . 177.Fa print-length 178also accounts for the line-continuation character (backslash) at 179the end of each line, and the doublequotes at the beginning and end 180of the signature encoding. Default values are 12 and 50 respectively. 181.Pp 182.Sh SIGNATURE VERIFICATION 183"keynote sigver" reads the assertions contained in 184.Fa AssertionFile 185and verifies the public-key signatures on all of them. 186.Pp 187.Sh QUERY TOOL 188For each operand that names a 189.A file , 190"keynote verify" reads the file and parses the assertions contained 191therein (one assertion per file). 192.Pp 193Files given with the 194.Fl l 195flag are assumed to contain trusted assertions (no signature 196verification is performed, and the 197.Fa Authorizer 198field can contain non-key principals. 199There should be at least one assertion with the 200.Fa POLICY 201keyword in the 202.Fa Authorizer 203field. 204.Pp 205The 206.Fl r 207flag is used to provide a comma-separated list of return values, in 208increasing order of compliance from left to right. 209.Pp 210Files given with the 211.Fl e 212flag are assumed to contain environment variables and their values, 213in the format: 214.Bd -literal -offset indent 215 varname = "value" 216.Ed 217.Pp 218.Fa varname 219can begin with any letter (upper or lower case) or number, 220and can contain underscores. 221.Fa value 222is a quoted string, and can contain any character, and escape 223(backslash) processing is performed, as specified in the KeyNote 224RFC. 225.Pp 226The remaining options are: 227.Bl -tag -width indent 228.It Fl h 229Print a usage message and exit. 230.It Fl k Ar file 231Add a key from 232.Fa file 233in the action authorizers. 234.El 235.Pp 236Exactly one 237.Fl r 238and least one of each 239.Fl e , 240.Fl l , 241and 242.Fl k 243flags should be given per invocation. If no flags are given, 244"keynote verify" prints the usage message and exits with error code \-1. 245.Pp 246"keynote verify" exits with code \-1 if there was an error, and 0 on success. 247.Pp 248.Sh SEE ALSO 249.Xr keynote 3 , 250.Xr keynote 4 , 251.Xr keynote 5 252.Bl -tag -width "AAAAAAA" 253.It ``The KeyNote Trust-Management System, Version 2'' 254M. Blaze, J. Feigenbaum, A. D. Keromytis, 255Internet Drafts, RFC 2704. 256.It ``Decentralized Trust Management'' 257M. Blaze, J. Feigenbaum, J. Lacy, 2581996 IEEE Conference on Privacy and Security 259.It ``Compliance-Checking in the PolicyMaker Trust Management System'' 260M. Blaze, J. Feigenbaum, M. Strauss, 2611998 Financial Crypto Conference 262.El 263.Sh AUTHOR 264Angelos D. Keromytis (angelos@dsl.cis.upenn.edu) 265.Sh WEB PAGE 266http://www.cis.upenn.edu/~keynote 267.Sh BUGS 268None that we know of. 269If you find any, please report them at 270.Bd -literal -offset indent -compact 271keynote@research.att.com 272.Ed 273