简体   繁体   English

如何在Linux中将时间戳记写入Windows注册表和conf

[英]How to write a timestamp to windows registry and conf in linux

I am new to commercial software development. 我是商业软件开发的新手。 I am working towards developing 2 versions of a Java based tool. 我正在努力开发基于Java的工具的2个版本。
1) Trial Version (30 Days free use) 1)试用版(30天免费使用)
2) Full version 2)完整版
As I understand for the trial version the start date has to be recorded in registry or conf file. 据我了解,试用版的开始日期必须记录在注册表或conf文件中。 But I am unable to identify how can I write a Java program which will write a timestamp to registry and conf files. 但是我无法确定如何编写一个Java程序,该程序将向注册表和conf文件写入时间戳。 Can anyone please help me understand how to do so. 谁能帮我了解如何做。

Preferences API is what you need. 首选项API是您所需要的。

But going back to your original goal, it is much more difficult to implement such system than just writing your timestamp into the system repository or some other storage. 但是回到最初的目标,要实现这样的系统比将时间戳写入系统存储库或其他存储要困难得多。

You need to be sure that: 您需要确保:

  • You are using 'source' of time you can trust to 您正在使用可以信赖的时间“来源”

  • Nobody can change timestamp you have saved somewhere - you need to sign it in some way 没有人可以更改保存在某处的时间戳-您需要以某种方式对其进行签名

  • You need to periodically update timestamp and store it in different places to defend yourself against time rollbacks (so system could say that current time is in past) 您需要定期更新时间戳并将其存储在不同的位置,以保护自己免受时间回滚的影响(因此系统可以说当前时间已过去)

  • In ideal case you need to check license on some licensing server 在理想情况下,您需要在某些许可服务器上检查许可

Even if you are sure about your timestamp source, there is also high chances that your licensing library will be decompiled with JD-GUI and checking code removed. 即使您确定时间戳记的来源,也很有可能使用JD-GUI对许可库进行反编译并检查代码是否已删除。

To make your check strong enough you need: 为了使您的支票足够坚固,您需要:

  • Use obfuscation for all your system modules (have a look on http://proguard.sourceforge.net ) 对所有系统模块使用混淆处理(请参阅http://proguard.sourceforge.net

  • Keep in mind that someone can just add new dependency in the classpath and affect on your license logic in runtime 请记住,有人可以在类路径中添加新的依赖项并在运行时影响您的许可证逻辑

  • Put check method invocation in different places of your system 将检查方法调用放在系统的不同位置

  • Use ciphering for all license-related data 对所有与许可证相关的数据使用加密

  • Bind license to the particular machine using hardware IDs (CPU's, network devices, etc.) 使用硬件ID(CPU,网络设备等)将许可证绑定到特定计算机

  • Encode issuing date into the license by itself 自行将签发日期编码到许可证中

  • License file need to encrypted with authorised authority key (read about public/private ciphering ) and your system build should be also signed with appropriate key which means that you need to have well defined system build & signing flow 许可证文件需要使用授权的授权密钥进行加密(有关公共/私有密码的信息),并且您的系统构建也应使用适当的密钥进行签名,这意味着您需要具有良好定义的系统构建和签名流程

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

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