def instance_password(self): """Get the password posted by the instance.""" _, encoded_password = self._servers_client.get_password( self._server['id']) return util.decrypt_password( private_key=CONF.argus.path_to_private_key, password=encoded_password['password'])
def decrypt_password(password, private_key): """Decript the password using the private key. :param password: The password we want to decrypt :param private_ley: The private key to use """ with util.create_tempfile(private_key) as tmp: return util.decrypt_password(private_key=tmp, password=password)
def decrypt_password(password, private_key): """Decrypt the password using the private key. :param password: The password we want to decrypt :param private_ley: The private key to use """ with util.create_tempfile(private_key) as tmp: return util.decrypt_password( private_key=tmp, password=password)
def instance_password(self, instance_id, keypair): """Get the password posted by the given instance. :param instance_id: The id of the instance for which the password will be returned. :param keypair: A key-pair whose private key can be used to decrypt the password. """ encoded_password = self.servers_client.show_password(instance_id) with _create_tempfile(keypair.private_key) as tmp: return util.decrypt_password(private_key=tmp, password=encoded_password['password'])
def instance_password(self, instance_id, keypair): """Get the password posted by the given instance. :param instance_id: The id of the instance for which the password will be returned. :param keypair: A key-pair whose private key can be used to decrypt the password. """ encoded_password = self.servers_client.show_password( instance_id) with _create_tempfile(keypair.private_key) as tmp: return util.decrypt_password( private_key=tmp, password=encoded_password['password'])