Techniques for using wireless electronic keys with devices are disclosed. For example, a computer system can program an access code into a programmable wireless electronic key. An action or function of the device can then be made contingent on there being a match between the access code from the key and an access code known by the device. Also, audit data such as device access history can be wirelessly transferred from a device to an electronic key, whereupon the key can later transfer this audit data to a computer for analysis.