Outline Of Diagnosis
WARNING: This page is about a different car, the 2006 Subaru Outback. However, it is still accessible from the selected car via links, so may be relevant.
For the detection standard, refer to DTC P0513 INCORRECT IMMOBILIZER KEY , Diagnostic Trouble Code (DTC) Detecting Criteria.