Sherwin, J.
The Iowa Loan & Trust Company is an Iowa corporation that since 1881 has been doing a loaning business, and issuing and selling its own obligations, called “debentures,” wherein the company promised to pay a specific sum with interest on a specified date. The debentures so sold were secured by real estate securities, in the form of notes and mortgages, which were desposited with trustees appointed by the company, in accordance with a written agreement between said company and the trustees. The agreement among other things provided: “The debentures of the said company, to be issued hereafter, shall be in series of one hundred thousand dollars each, but the several bonds composing any series may be of different denominations, as may be found convenient. Each series shall become due at a fixed date, to be expressed upon the face of the bond; but may reserve an option of payment after a date specified, before maturity, at the pleasure of said company. As security for the payment of debentures as aforesaid, the said Iowa Loan & Trust Company may, from time to time at its pleasure, set over, transfer, and assign to said trustees, real estate securities, to be held by said trustees, in trust for the benefit of the purchasers of *68said debentures; whereupon.the said trustees shall indorse their certificate of such fact -upon debentures not exceeding one thousand dollars for every one thousand and fifty dollars of securities so transferred to them. Each series of debentures shall be wholly independent of any other series, in the matter of securities, and said trustees shall not certify or countersign any debentures for which they do not hold at least five percent of securities in excess of the bonds so countersigned. It is expressly agreed that, whenever the said Iowa Loan & Trust Company shall produce and surrender any of the debentures which have been countersigned by said 'trustees, said trustees, when requested by said company so to do, shall redeliver a pro rata share of the securities pledged for the payment of said series; whereupon the debentures so surrendered shall be canceled.” The trustees are George M. Ilippee, C. A. Dudley, and J. G. Hounds. C. II. M.urrow, as treasurer of Polk County, assessed these trustees as agents and trustees for unknown owners, nonresidents of the state, on property alleged to have been omitted from assessment for the years 1903 to 1907, inclusive. The trustees appealed to the district court, and upon the trial of said appeal the treasurer filed a petition, asking that the Iowa Loan & Trust Company and its president, W. C. Coffin, and its secretary, Edwin Ilult, be required to produce in court “all books containing a registry of the debentures and names of the owners outstanding of the Iowa Loan & Trust Company for the years 1902, 1903, 1904, 1905, 1906, and 1907, and all canceled and paid debenture bonds, between the years 1898 and 1907 both inclusive.” After full argument by both sides, the court made an order requiring the company and its officers to show7 cause why the records asked for should not be produced for the inspection of the court and counsel. In this order the court said that the records appeared to be necessary and material for the purpose of determining whether the holders of the debenture bonds were residents or non*69residents of the state. Thereafter an amendment to the petition was filed, and resistance to the application was made. The matter was again fully argued, and finally, on. the 12th of November, 1908, the court made a written order finding that the treasurer was entitled to an order for the production of the records, and it was accordingly made. The Iowa Loan & Trust Company refused to comply therewith, and at once commenced this proceeding. It is, of course, not claimed that the legality of the assessment of the trustees by the treasurer can be reviewed in this proceeding.
_ i. Evidence: production of books and papers. The principal contention of the petitioners is that the residence of the owners and holders of the debenture bonds issued by the trust company is immaterial, because the holders of the debentures do not own the securities that are in the hands of the trustees for their protection. Section 4654 of the Code provides that the court may in its discretion require the production of any books or papers which are material to the just determination of any cause pending before it “for the purpose of being inspected and copied by or for the party thus calling for them.” Section 4655 requires the petition for a rule for the production of books and papers to show wherein they are material, and it further says that the rule shall thereupon be granted. The petitioners’ position is that the books and papers to be produced must be material, and the materiality thereof must be shown by the petition, and be determined by the court before an order can be made for their production. The sections of the statute under consideration authorize a rule for the production of books and papers only when it is made to appear by the petition therefor that the same are material to the just determination of the cause then pending before it. While the court is given discretion in the matter, it is the plain intent of the statute that no rule shall be granted unless it is made to appear to the court, either by *70the petition or upon a hearing where the issuance of the rule is resisted, that the books and papers are material to the issues then before the court. Beebe v. Ins. Co., 76 Iowa, 129; Sheldon v. Mickel, 40 Iowa, 19. The trial court did determine that the books of -the loan and trust company were material to the determination of the issue between the treasurer and the trustees. This is apparent from his order to show cause, from his order for their production, and from the running argument between the court and counsel on both sides while the application was being heard. The court had jurisdiction of the subject-matter and of the parties in the appeal case in which the books were wanted. The statute makes no distinction between the books and papers belonging to or' in the possession of a party to the suit and those belonging to a stranger. All are subject to the rule upon a proper showing. In ordering the books, then, the trial court was exercising a discretion given to it hy the statute under which it acted, and the order can not he reviewed by this court on certiorari.
2. Same: certiorari:. scope of review. The question presented by the writ is whether the defendant exceeded his jurisdiction, or otherwise acted illegally. If his action was merely erroneous, a writ of certiorari will not lie. The distinction be- , i i *n i tween an erroneous order and an illegal one is thus stated in Tiedt v. Garstensen, 61 Iowa, 334: “When the law prescribes proceedings to be had by an officer or tribunal in cases pending before them, the omission of such proceedings is in violation of law, and the court or officer omitting them would therefore act illegally. In a word, if a tribunal, when determining-matters before it which are within its jurisdiction, proceeds in a manner contrary to law, it acts illegally. But, if a discretion is conferred upon the inferior tribunal, its exercise can not be illegal. If it be clothed with authority to decide upon facts submitted to it, the decision is not *71illegal, whatever it may be, if the subject-matter and the parties are within its jurisdiction, for the law intrusts the decision to the discretion of the tribunal.” See, also, Wise v. Chaney, 67 Iowa, 73; Medical College Ass’n v. Schrader, 87 Iowa, 659; Voting Machine Co. v. Hobson, 132 Iowa, 38; Finn v. District Court, 145 Iowa, 157. As we have heretofore said, there was a rule to show cause, and the whole matter was argued out. The petition alleged that. the books were material, and alleged what they would prove. We think the question of their materiality was therefore sufficiently pleaded. At any rate, no objection seems to have been made to the sufficiency of the petition, nor to the time of making same. The petitioners seem to fear that the trial court will permit their records to be used for improper purposes, not connected with the determination of any issue before the court. We can not presume, and counsel are not warranted in presuming, that the trial court will permit any undue examination of or license with the books. While providing for the just determination of a cause, the court should also see that instruments of evidence are not misused.
3 Same: constitutional law: search and seizure. The constitutional guaranty against unreasonable searches and seizures is not in our judgment violated by the order. Nor will it be by an execution thereof. The provisions of the Constitution have no referenee regularly prescribed and statutory methods for obtaining evidence, and the acquiring of evidence in the statutory manner to be used in a case is not a search or seizure within the meaning of the Constitution. Cooley’s Constitutional Limitations, 364; Robinson v. Richardson, 13 Gray (Mass.) 454; In re Chapman, 166 U. S. 661 (17 Sup. Ct. 677, 41 L. Ed. 1154); Finn v. District Court, supra. While many other points are argued by the petitioners, we believe that we have discussed and determined the one vital question in the proceeding, and we need not extend this opinion by *72a discussion of questions which must necessarily arise when the case between the treasurer and the trustees is finally tried.
We. think the order of the trial judge should be affw'med and the writ dismissed.
Evans, J.
(dissenting). — I reach a contrary conclusion. I think that the writ of certiorari is available to the plaintiffs upon the showing made in their petition therefor. They were not party to the proceeding in which the rule upon them to produce their books was entered. Therefore they could have no remedy by appeal in that case. Nor was there any other remedy available to them in order to obtain a review of the action of the district court. The case therefore'is well within the express provisions of section 4154, which provides for the writ of certiorari as a means of reviewing the action of the lower court “in all cases” where such court “is alleged” to be “acting illegally,” and there is no other “plain, speedy, and adequate remedy.” So far, therefore, as the question of practice is involved, I think the plaintiffs adopted proper procedure.
True, the plaintiff loan company and its officers could have ignored the order and subjected themselves to a commitment for contempt, whereby a writ of habeas corpus would have been available to them. But the lower court considerately and properly suspended the enforcement of ■the order until the question of its legality could be properly passed on by this court, and the plaintiff and its officers have adopted the only procedure available to them for that purpose. The trial 'court could, of course, have enforced its order summarily. If it had done so, then, and not till then, a writ of habeas corpus would have been the only remedy available to petitioners. In view, however, of the suspension of enforcement, an opportunity is presented to review the order of the lower court by this proceeding. To *73deny absolutely the remedy by certiorari is to drive the petitioners to the necessity of committing contempt of court before they can have any remedy at all. It seems to me that this is contrary to both letter and spirit of section 4154. I think, therefore, that we ought to pass herein upon the question of the legality of the order of the trial court.
II. Turning to the merits of the controversy, the order complained of was entered by the district court in purported pursuance of sections 4654 and 4655. The power conferred by these sections is limited in its application to those “papers or books which are material to the jxist determination of any cause” pending before the court. Section 4655 expressly requires that the petition for the production of books and papers shall “state the facts expected to be proved by such books and papers,” and that it must show “wherein they are material.” , The emphasis of the statute is upon the materiality of the books and papers thus sought as a prerequisite to the issuance of a rule for the production of the same. As bearing upon this question of materiality, the showing of facts as it appears in the record before us is substantially as set forth in the majority opinion. The plaintiff loan company issued its negotiable- notes or debentures totaling some hundreds of thousands of dollars, and these passed into the hands of many holders. Lor the purpose of securing these outstanding notes, it put up in the hands of the trustees, notes, and mortgage securities which it held against others. The county treasurer proceeded upon the theory that the mortgage securities so held by the trustees as collateral security for the holders of the plaintiff’s outstanding obligations became thereby the property of the owners and holders of such debenture obligations, and upon the further theory that the collateral mortgage securities so held by the trustees for nonresident, owners and holders of such debenture obligations could be assessed in the hands of the trustees as agents for such *74nonresidents. The .alleged materiality of the books and papers sought to be produced is based upon the claim that such books would disclose the extent to which such collateral securities were held for the benefit of nonresidents. If the proposition is legally sound that the owners and holders of the debenture obligations of the plaintiff were also the owners of the collateral securities in the hands of the trustees in such sense as to be assessable therefor as assets additional to the debentures which they held, then it may be conceded that the books and papers sought were material to a just determination of the case in which the rule for their production was issued. If such proposition is not sound, then such books and papers had no materiality whatever, and the statute afforded the court no warrant for their compulsory production. To my mind, this is the vital question in the case, and it is not dealt with in the majority opinion.
/That a debtor who puts up collateral security in the hands of his creditor to secure his own obligations to such creditor remains the equitable and beneficial owner of such collateral is elementary. True, the creditor has rights in such collateral, but it is no part of • his assets. It is a part of the assets of the debtor, and is to be taken account of in determining his assessment. The creditor holds it as trustee for the debtor, and is bound to account for it under the strict rules which apply to a trusteeship. To illustrate, if a creditor hold the note of his debtor for $1,000 secured by collateral notes for $2,000, the asset of the creditor is not thereby increased in a legal sense by the taking of such security. Nor are the assets of the debtor decreased by the giving of such security. For the purpose of assessing the creditor on such item, the obligation of his debtor to him must be deemed his asset. It could not be deemed trebled because its payment was secured. On the other hand, the $2,000 collateral must bo taken account of in the assessment of the debtor as a part of *75his assets properly subject to offset for his debts. This illustration covers the entire case made by the county treasurer in the proceeding wherein the rule complained of was entered. The real estate mortgages and notes placed in the hands of the trustees by the plaintiff herein for the purpose of securing defendant’s outstanding debenture obligations still remain the assets of the plaintiff loan company. Its creditors had rights of security therein, but these rights were purely incidental to the principal debt held by each creditor, and added nothing to such principal debt as a measure of his asset. If, instead of putting up these mortgage securities in the hands of fixed trustees, the plaintiff loan company had distributed and delivered them to the respective debenture holders, then such debenture holders would themselves become trustees of such collateral, and would become accountable for the same as such to the plaintiff loan company as the equitable owner.
This is perhaps a sufficient discussion to show the point which is in my mind. If I am correct thus far, it necessarily follows that the question whether the holders of debentures Avere resident or nonresident was without any materiality whatever, and the issuance of the rule for the production of plaintiff’s books was wholly unwarranted under the statute. Nor can I .see hoAV such a result can be deemed in any sense an embarrassment to the public authorities. In so far as these securities are assessable, they can be readily reached through the plaintiff as their OAvner, subject to just rights of offset for debts. So far as appears in this record, the plaintiff has always been fully assessed, and, if so, account has necessarily been taken of these assets. If not, the remedy against the plaintiff is ample.
III. The majority opinion holds that, inasmuch as the loAver court had found that the books and papers sought to be produced Avere material, such finding is conclusive upon us upon a review of its action. I can not assent *76to this view. Under this holding, the right of review would be utterly barren. Indeed, no review of the action of the lower court would be possible under any circumstances or by any procedure if its determination of the materiality of the proposed evidence is to be deemed conclusive on the reviewing tribunal. I can see no sound reason why its determination at that point should be any more conclusive upon the reviewing tribunal than its determination of any other legal question which entered into the legality of its order. Surely if the matter were before us on habeas corpus, the question of the legality of the imprisonment would have to be determined by us.
The vital inquiry, in such case would be whether the books sought to be produced were material, and not whether the committing tribunal held them to be such.
Upon this record, I think the writ should be sustained, and the order complained of should be annulled.