Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.runescape;
- import java.io.File;
- import java.io.FileReader;
- import java.security.interfaces.RSAPrivateKey;
- import java.security.interfaces.RSAPublicKey;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import com.runescape.networking.SevadorHandler;
- import com.runescape.utility.Config;
- import com.runescape.utility.secure.RSA;
- import com.runescape.utility.secure.RSAKeygen;
- /**
- * The main execution class of the Sevador framework.
- *
- * @author Tyluur
- */
- public class Server {
- /**
- * The configuration file used to initialize main server variables.
- */
- public static final String CONFIG_FILE = "./config.ini";
- /** The logger instance. */
- private static Logger logger = Logger.getLogger(Server.class.getName());
- /**
- * Starter method.
- *
- * @param args
- * The program arguments
- */
- public static void main(String[] args) {
- logger.info("Starting Sevador framework, please wait...");
- try {
- loadConfig();
- new SevadorHandler();
- logger.info("Startup complete.");
- } catch (Exception ex) {
- logger.log(Level.SEVERE, "Unable to start.", ex);
- }
- }
- /**
- * Loads configuration.
- *
- * @throws Exception
- */
- private static void loadConfig() throws Exception {
- Config.getProperties().load(new FileReader(CONFIG_FILE));
- File privateKey = new File(Config.getProperties().getProperty("rsa_private_key"));
- RSA.setPrivateKey((RSAPrivateKey) RSAKeygen.loadPrivateKey(privateKey));
- File publicKey = new File(Config.getProperties().getProperty("rsa_public_key"));
- RSA.setPublicKey((RSAPublicKey) RSAKeygen.loadPublicKey(publicKey));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement