Created various functions to work with the keystore.