1.\" $NetBSD: btkey.1,v 1.4 2009/05/18 12:03:06 wiz Exp $ 2.\" 3.\" Copyright (c) 2007 Iain Hibbert 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. The name of the author may not be used to endorse or promote products 15.\" derived from this software without specific prior written permission. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27.\" 28.Dd November 8, 2007 29.Dt BTKEY 1 30.Os 31.Sh NAME 32.Nm btkey 33.Nd Bluetooth Link Key management utility 34.Sh SYNOPSIS 35.Nm 36.Op Fl CcRrWw 37.Op Fl k Ar key 38.Fl a Ar address 39.Fl d Ar device 40.Nm 41.Fl Ll 42.Op Fl d Ar device 43.Sh DESCRIPTION 44The 45.Nm 46program is used to manage Bluetooth Link Key storage. 47Keys are normally handled by the 48.Xr bthcid 8 49daemon which caches them in the 50.Pa /var/db/bthcid.keys 51file and provides them as required when Bluetooth connections 52need to be authenticated. 53.Pp 54These keys are required for connections between remote 55devices and the specific controller 56.Pq not the Operating System 57and so for multi-boot systems where it may not always be possible to 58specify the same key across all OS's it can be better to have the 59Bluetooth controller provide the keys directly from its semi-permanent 60memory once devices are paired. 61.Nm 62will read, write or clear keys in device memory or the key cache 63as required. 64.Pp 65Note that without the 66.Xr bthcid 8 67daemon running users will be unable to supply PINs, and Link Keys 68resulting from new pairings will not be stored. 69If no new pairings are expected and the keys are stored in 70the controller then 71.Xr bthcid 8 72is not required. 73.Pp 74The options are as follows: 75.Bl -tag -width ".Fl a Ar address" 76.It Fl a Ar address 77Specify the remote device address. 78May be given as a BDADDR or a name. 79.It Fl C 80Clear key from device. 81.It Fl c 82Clear key from file. 83.It Fl d Ar device 84Specify the local device address. 85May be given as a BDADDR or a name. 86.It Fl k Ar key 87Supply a Link Key as a string of hexadecimal digits. 88Up to 32 digits will be processed and the resulting key 89will be zero padded to 16 octets. 90.It Fl L 91List keys stored in device. 92.It Fl l 93List keys stored in file. 94.It Fl R 95Read key from device. 96.It Fl r 97Read key from file. 98.It Fl W 99Write key to device. 100.It Fl w 101Write key to file. 102.El 103.Pp 104Super-user privileges are required to read or write link keys. 105.Sh EXIT STATUS 106.Ex -std 107.Sh FILES 108.Bl -item -compact 109.It 110.Pa /var/db/bthcid.keys 111.El 112.Sh EXAMPLES 113Read key for mouse at ubt0 from file and write to device 114.Pp 115.Dl btkey -d ubt0 -a mouse -rW 116.Pp 117Write new key for keyboard at ubt0 to file 118.Pp 119.Dl btkey -d ubt0 -a keyboard -k 92beda6cd8b8f66ebd2af270d55d70ec -w 120.Pp 121Clear key for phone at bt3c0 from file and device 122.Pp 123.Dl btkey -d bt3c0 -a phone -cC 124.Sh SEE ALSO 125.Xr btpin 1 , 126.Xr btconfig 8 , 127.Xr bthcid 8 128.Sh AUTHORS 129.An Iain Hibbert 130