A method for safely switching between product state and and development state of a terminal, characterized by comprising: presetting a product CA, certificate authority, and a development CA; pre-arranging the product CA and the development CA in the terminal; presetting flags in a FLASH inside the terminal so as to correspond to a product state and a development state respectively; generating a product public-private key pair by a first encryptor, and generating a development public-private key pair by a second encryptor; issuing a product certificate containing the product public key by using the product CA, and issuing a development certificate containing the development public key by using the development CA; storing the product certificate and the product private key in a product secure storage medium, and storing the development certificate and the development private key in a development secure storage medium; sending by a host computer a CA state switching instruction to the terminal; sending by the terminal the current state to the host computer according to the flags; reading by the host computer the private key and the certificate stored in one secure storage medium; sending by the host computer the certificate to the terminal; verifying by the terminal the validity of the certificate by using the CA corresponding to the current state so as to obtain a fifth verification result; verifying by the terminal the validity of the private key so as to obtain a sixth verification result; determining that said one secure storage medium corresponds to the current state of the terminal, if the results of both the fifth verification and the sixth verification are valid; and formatting a key storage area of the terminal to clear sensitive information on the current state of the terminal; and switching the terminal to another state by rewriting the flags. presetting a product CA, certificate authority, and a development CA; pre-arranging the product CA and the development CA in the terminal; presetting flags in a FLASH inside the terminal so as to correspond to a product state and a development state respectively; generating a product public-private key pair by a first encryptor, and generating a development public-private key pair by a second encryptor; issuing a product certificate containing the product public key by using the product CA, and issuing a development certificate containing the development public key by using the development CA; storing the product certificate and the product private key in a product secure storage medium, and storing the development certificate and the development private key in a development secure storage medium; sending by a host computer a CA state switching instruction to the terminal; sending by the terminal the current state to the host computer according to the flags; reading by the host computer the private key and the certificate stored in one secure storage medium; sending by the host computer the certificate to the terminal; verifying by the terminal the validity of the certificate by using the CA corresponding to the current state so as to obtain a fifth verification result; verifying by the terminal the validity of the private key so as to obtain a sixth verification result; determining that said one secure storage medium corresponds to the current state of the terminal, if the results of both the fifth verification and the sixth verification are valid; and formatting a key storage area of the terminal to clear sensitive information on the current state of the terminal; and switching the terminal to another state by rewriting the flags. <EOS>