Launcher/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerRuntimeConfig.java
2021-05-25 16:17:29 +07:00

29 lines
1.1 KiB
Java

package pro.gravit.launchserver.config;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import pro.gravit.utils.helper.SecurityHelper;
public class LaunchServerRuntimeConfig {
private transient final Logger logger = LogManager.getLogger();
public String passwordEncryptKey;
public String runtimeEncryptKey;
public String oemUnlockKey;
public String registerApiKey;
public String clientCheckSecret;
public void verify() {
if (passwordEncryptKey == null) logger.error("[RuntimeConfig] passwordEncryptKey must not be null");
if (clientCheckSecret == null) {
logger.warn("[RuntimeConfig] clientCheckSecret must not be null");
clientCheckSecret = SecurityHelper.randomStringToken();
}
}
public void reset() {
passwordEncryptKey = SecurityHelper.randomStringToken();
runtimeEncryptKey = SecurityHelper.randomStringAESKey();
registerApiKey = SecurityHelper.randomStringToken();
clientCheckSecret = SecurityHelper.randomStringToken();
}
}