Jini is an infrastructure built on top of the mobile code facilities of the Java programming language enabling clients and services to spontaneously engage in arbitrary usage scenarios. For a small home or office environment the currently available infrastructure might be adequate, but for mission-critical applications it lacks essential security properties. In the sequel we identify weak points in the Jini architecture and its protocols and propose an extension to the architecture that provides a solution to the identified security problems. We describe the design choices underlying our implementation which aims at maximum compatibility with the existing Jini specifications.