()
| 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 { |
no test coverage detected