Techniques for using wireless electronic keys with electronic locks are disclosed. For example, a computer system can program an access code into a programmable wireless electronic key, and the programmable electronic key can then teach this access code to a programmable electronic lock via wireless communication to thereby program the programmable electronic lock. Unlocking action by the programmed lock can then be made contingent on there being a match between the access code from the key and the access code from the programmed lock. Further still, other operational control parameters (such as time limits) can be programmed into the key to restrict the ability of the key to unlock a lock. Also, audit data such as lock access history can be wirelessly transferred from an electronic lock to an electronic key, whereupon the key can later transfer this audit data to a computer for analysis.