(a) Under regulations prescribed by the Secretary of Defense, each officer required under section 1181 of this title to show cause for retention on active duty—
shall be notified in writing, at least 30 days before the hearing of his case by a board of inquiry, of the reasons for which he is being required to show cause for retention on active duty;
shall be allowed a reasonable time, as determined by the board of inquiry, to prepare his showing of cause for his retention on active duty;
shall be allowed to appear in person and to be represented by counsel at proceedings before the board of inquiry; and
When a record is withheld under subsection (a)(4), the officer whose case is under consideration shall, to the extent that the interest of national security permits, be furnished a summary of the record so withheld.