PURPOSE: To provide a card key which is hard to forge by installing optical filters that transmit light of predetermined wavelength bands in a card key and on a lower base, and enabling unlocking only if light received as the transmission wavelength bands of the two filters are coincident.
CONSTITUTION: A switch is turned on by inserting into an inlet 5 a card key 6 having an optical filter 7a'-7f' which transmits light of a predetermined wavelength band, and then light rays of different wavelength ranges are emitted from a plurality of light-emitting elements 3a-3e. Next, the light rays reflected by a grating mirror 2 and transmitted through the filter 7a'-7f' of the card key 6 are filtered through an optical filter 7a-7f provided to a lower base 9. When the transmission wavelength bands of the two filters are the same, a light-receiving element provided to the lower base 9 receives the light rays and unlocking is done in accordance with that result. A card key which is hard to forge can thus be obtained.