Securing the mobile code commerce is not an easy task at all. We propose in this paper a framework to tackle this problem. In a first step, we analyse the general issues that must be addressed. In a second step we list the possible techniques that can be used for that purpose. In a third step, we build a framework based on the analysis done. This framework has been implemented to show its validity. Keywords. electronic commerce, electronic right management, copyright protection, software piracy, obfuscation, watermarking