securing the keystore When generating a public-private key pair you have the option to secure the keystore with a password. 

where is that password stored, is it a hashed version that is stored and if that is so which hashing algorithm is used ?
There are a lot of fancy things one can do when we start talking about sharing access a key store that Maarten mentions in this comment. I'll stick with just a very simple setup. You have a private key file (e.g., ssh private key). You don't want that file accessible to an attacker who steals your laptop, so the software asks you to supply a password to control access to that file.

The way these typically work is that symmetric keys are generated using your password (e.g., using bcrypt or PFKDF2). The keys are then used to encrypt the private key file. This would be done using an authenticated encryption mode of operation. These modes produce the ciphertext and a tag, which can be used to ensure that the ciphertext has not changed (note: a MAC like HMAC over the ciphertext would also work).

Now, when you supply a password again in the future to decrypt the file, the software runs that password through the same function to generate a key. If the same password is supplied, the same key is generated. Then it can attempt to decrypt the file. If the wrong key is supplied, or the ciphertext has been altered, decryption will fail due to the mode of operation used.

So it is the authentication tag over the ciphertext that is used to determine if either the wrong password was supplied or the ciphertext was altered.