PURPOSE: To raise the function of a mechanical key by a method in which discriminating information of users and unlocking apparatus is input, locking or-unlocking operation is made by using a key kept under usable state and locking or unlocking information is stored in the key and output to the external device when needed.
CONSTITUTION: A key is provided with an insert part 14, a registration memory 20 having the unlocking codes of all users and all devices 10 to be unlocked, an user and device input unit 22, an unlocking controller 26, an unlocking history memory 28, and an unlocking history output unit 30. In using the key, discriminating information on users and devices 10 to be unlocked is input to the key by the input unit 22, and the input information is compared with the information of the memory 20 through the controller 26 to permit the use of the key. The insert part 14 is then inserted into a key cylinder 12 and an electromagnet 18 in compliance with unlocking code is excited for unlocking, and various pieces of information during unlocking period are stored in the memory 28 and output to outside from the unit 30. Admimistration can thus be simplified, apparatus cost can be reduced, and the copying of the key can also be prevented.