I solely own a C Corporation and do not plan to distribute any dividends nor pay myself any salary - is this legal?

Hello,

I solely own a C Corporation and do not plan to distribute any dividends nor pay myself any salary - is this legal? 

If not, at what point/income do I require to pay myself salary/dividends. I would like to keep all corporate earnings inside the corporation and not take any funds out for several years, can I do that?

Thank you.