fix methods for generate keys returns key handle