California Penal Code Section 647(e) was repealed in 2008. It is no longer the law of the land.
In California, if you are not under arrest, you are not required to identify yourself. Of course, if you're driving, you can be asked for your driver's license, it is a crime to not produce it. If you're just walking, you are not required to produce any ID document.
Once you are under arrest, any item on your person may be taken from you in the process of a custodial search. Trying to prevent an officer from taking something from you can be construed as resisting arrest.
That being said, resisting arrest is one of the most common bogus charges levied by police when a stop isn't going the way they like it to, and is one of the most commonly dismissed charges. I'd get with a lawyer to discuss the specifics of your case, you may be able to get that thrown out, or you may not.