The invention discloses an asymmetric-
algorithm-based
certificate medium online-formatting method and an asymmetric-
algorithm-based
certificate medium online-locking method. The formatting method comprises the following steps that a medium management interface generates a one-time random code R1 and a medium sequence number KSN, a
server acquires a corresponding management
password SOPIN1 of a medium according to the KSN, performs
encryption and signature, and transmits a result to a
client, and the
client verifies and decrypts the result to finish formatting. The unlocking method comprises the following steps that the medium management interface acquires a signed
certificate sequence number SN and the medium sequence number KSN, and generates a one-time random code R3; the
server acquires the management
password SOPIN1 by using the KSN, encrypts and signs received data, and transmits the data to the
client; the medium management interface performs signature
verification and decryption, compares a decryption result, and resets a user
password to be a
default password if the one-time random code R3 is the same as the decryption result. According to the methods, the password security of the certificate medium can be ensured in large-scale public key infrastructures.