1 Exhibit 5 [Letterhead of McCutchen, Doyle, Brown and Enersen LLP] January 10, 2000 (415) 393-2000 Heritage Commerce Corp 150 Almaden Boulevard San Jose, CA 95113 REGISTRATION STATEMENT ON FORM S-8 Ladies and Gentlemen: We have acted as counsel for Heritage Commerce Corp, a California corporation, (the "Company"), in connection with the Registration Statement on Form S-8 (the "Registration Statement") filed by the Company with the Securities and Exchange Commission under the Securities Act of 1933, as amended, relating to the registration of 162,576 shares of the Company's common stock to be issued under the Heritage Commerce Corp 1994 Tandem Stock Option Plan. We are of the opinion that the securities to be issued by the Company pursuant to the Registration Statement have been duly authorized and, when sold pursuant to the terms described in the Registration Statement, will be duly and validly issued, fully paid and nonassessable. We hereby consent to the filing of this opinion as Exhibit 5 to the Registration Statement. Very truly yours, McCUTCHEN, DOYLE, BROWN & ENERSEN, LLP By /s/ McCUTCHEN, DOYLE, BROWN & ENERSEN, LLP A Member of the Firm 11