MCPcopy Create free account
hub / github.com/Frontrooms/3.0-GC / loadKeys

Method loadKeys

src/main/java/emu/grasscutter/utils/Crypto.java:26–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 public static PrivateKey CUR_SIGNING_KEY;
25
26 public static void loadKeys() {
27 DISPATCH_KEY = FileUtils.readResource("/keys/dispatchKey.bin");
28 DISPATCH_SEED = FileUtils.readResource("/keys/dispatchSeed.bin");
29
30 ENCRYPT_KEY = FileUtils.readResource("/keys/secretKey.bin");
31 ENCRYPT_SEED_BUFFER = FileUtils.readResource("/keys/secretKeyBuffer.bin");
32
33 try {
34 //These should be loaded from ChannelConfig_whatever.json
35 CUR_SIGNING_KEY = KeyFactory.getInstance("RSA")
36 .generatePrivate(new PKCS8EncodedKeySpec(FileUtils.readResource("/keys/SigningKey.der")));
37
38 CUR_OS_ENCRYPT_KEY = KeyFactory.getInstance("RSA")
39 .generatePublic(new X509EncodedKeySpec(FileUtils.readResource("/keys/OSCB_Pub.der")));
40
41 CUR_CN_ENCRYPT_KEY = KeyFactory.getInstance("RSA")
42 .generatePublic(new X509EncodedKeySpec(FileUtils.readResource("/keys/OSCN_Pub.der")));
43 }
44 catch (Exception e) {
45 Grasscutter.getLogger().error("An error occurred while loading keys.", e);
46 }
47 }
48
49 public static void xor(byte[] packet, byte[] key) {
50 try {

Callers 1

mainMethod · 0.95

Calls 3

readResourceMethod · 0.95
getLoggerMethod · 0.95
getInstanceMethod · 0.45

Tested by

no test coverage detected