java - 激活码

标签 java activation

我不确定该问题的标题应该是什么,但我在这里寻求帮助。

我在一家公司工作,该公司在 CORE JAVA 平台上制作基于桌面的应用程序。 我们提供激活码来激活我们的软件。 激活的概念是——

User enters the Activation code --> software hits our server and download all the required files --> activation completed.

Once in a day, our software hits our server to check if the activation code has been expired.

问题- 我们有一个没有常规互联网连接的新客户。不知何故,他们同意提供一次互联网连接-

User enters the Activation code --> software hits our server and download all the required files --> activation completed.

but after that no internet connection. I can stop the software to check with server about expiry Date of activation code. But the problem with me is-

1) How do I check whether the Activation code has actually expired? ( Activation code is valid for 1 year only)

2) If after expiry If user enters a new Activation code, how do I check this is a valid activation code with 1 year validity?

最佳答案

1) 您可以存储注册日期并将其与系统日期进行比较。当然,用户可以调整日期。我曾经有一些软件总是存储它看到的最后一个日期,如果有人将日期移到过去,它就会提示并过期。你可以做这样的事情,但当然它永远不会像与服务器交谈那么安全。

2) 为您的激活 key 创建一种格式,其中包含新 key 以及以前的 key 。所以第一个键是 A,这有助于与服务器通信并检查 A 是否正常。新 key 可能看起来像 AB,意思是“我替换 A,再添加一年的激活,并称为 B,所以一年后,我们将需要像 BC 这样的 key ”。您必须考虑一下如何安全地对其进行编码,但我非常有信心它可以工作(例如,您可以用 A 加密 B,然后 B 只能在具有激活码 A 的计算机上使用)。

关于java - 激活码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4543656/

相关文章:

function - “链接功能”和 'Activation function'

ios - 在 i 设备上持久存储许可证 key 的最佳方式

java - Android 媒体播放器在后台播放

java - Spring RabbitMQ 发布和 linux amqp-consumer 并带有确认

java - 当特定通知到达时调用电话

c++ - 适用于 Windows Phone 8.1 的最小应用程序(无 XAML): differences with desktop app

Maven 多个配置文件不工作

java - @JsonIgnore 和@Getter 注解

java - 尝试读取 url 处的 json 文件