You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.4 KiB
Java
32 lines
1.4 KiB
Java
package com.glxp.api;
|
|
|
|
import com.glxp.api.util.RsaUtils;
|
|
import org.springframework.context.ApplicationContextInitializer;
|
|
import org.springframework.context.ConfigurableApplicationContext;
|
|
|
|
public class ToolApplicationContextInitializer implements ApplicationContextInitializer {
|
|
|
|
@Override
|
|
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
|
|
String myKey = RsaUtils.readFileContent("");
|
|
System.out.println(myKey);
|
|
String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtaHLiDtscnwyee4lG9jC" +
|
|
"8GUEZYIuBoz49W3GSy2LEOVpKRyiQNCjRmybvQS5qKdsb3pV720HQJnv/nQLnsg/" +
|
|
"vWbFc9L09fEeJdDZxQOf8D7CHeVgLd8+fh/GezQCVLijGlbAVORXOrFo5McdyOds" +
|
|
"LJey1x4HxIR13a79JHB7sdve14A2aS6bQ7NPWu8hM9LpJd1hylsXgdBpR+iX3DPF" +
|
|
"eep8Sx8jPnWfUfGF2pDNE3h1uz9RylGBYUz4tDPzz0IXO7vZkyUFXeslzKFDFcmh" +
|
|
"hbn1tobX+al4XvfRpjoCjST2mRfqCt4aNuBDM1LHMzyMBVJpfui91ikLGMgP4Gdf" +
|
|
"swIDAQAB";
|
|
try {
|
|
// String result = RsaUtils.publicKeyDecrypt(myKey, publicKey);
|
|
// String hardInfo = MyHardWareUtils.getHardDiskSN();
|
|
// if (!result.equals(hardInfo)) {
|
|
// System.exit(1);
|
|
// }
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
System.exit(1);
|
|
}
|
|
}
|
|
}
|