简体   繁体   English

如何制作一个不可能是多实例的 javacard appet

[英]How can I make a javacard appet which is not possible to be multi instance

I want to create a javacard applet which could not be installed more than once at the same time.我想创建一个不能同时安装多次的 javacard 小程序。 It means if I instantiate applet once, It could not be possible to install another instance of that applet.这意味着如果我实例化一次小程序,就不可能安装该小程序的另一个实例。 However, if I delete the first instance, it should be possible to reinstall it.但是,如果我删除第一个实例,应该可以重新安装它。

If the package AID is always the same the installations should fail during the loading process automatically.如果包 AID 始终相同,则安装应该在加载过程中自动失败。

If the package and instance AIDs are using some pattern like an increasing last digit you could use JCSystem.lookupAID and try to iterate over the possible AIDs and fail if another instance is found.如果包和实例 AID 使用某种模式,例如增加最后一位数字,您可以使用JCSystem.lookupAID并尝试迭代可能的 AID,如果找到另一个实例则失败。

If you are taking into account that the AIDs are flexible you are out of luck on standard smart cards, what you need then is a global kind of data unique for all applets.如果您考虑到 AID 是灵活的,那么您在标准智能卡上就不走运了,那么您需要的是一种对所有小程序都独一无二的全局数据。 When using an UICC eg you could create a file in the file system and if your applet is part of the MNO's security domain you can check this file for existence.例如,当使用 UICC 时,您可以在文件系统中创建一个文件,如果您的小程序是 MNO 安全域的一部分,您可以检查该文件是否存在。

Maybe you also protect the installation process, eg by using a personalization process.也许您还可以保护安装过程,例如使用个性化过程。 After the installation a personalization server has to approve the applet.安装后,个性化服务器必须批准小程序。 The applet could use some random token and if this is not known by the personalization server the applet will never unlock some features to make it useful.小程序可以使用一些随机令牌,如果个性化服务器不知道这一点,小程序将永远不会解锁某些功能以使其有用。 This approach should always work.这种方法应该始终有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM