A device receives a password from a user, obtains a public key for a cryptographic algorithm for the device, obtains a password verifier by applying a one-way function to a combination of a unique identifier, the password and the public key, generates the certificate comprising the unique identifier, the public key and the password verifier, signs the certificate using a private key corresponding to the public key thereby obtaining a self-signed certificate, and outputs the self-signed certificate. Also provided is the device.