Examples of RSAKey


Examples of com.zaranux.client.crypto.spec.interfaces.RSAKey

        }
    }
*/
    // see JCE spec
    protected int engineGetKeySize(Key key) throws InvalidKeyException {
        RSAKey rsaKey = (RSAKey) key; // Saman RSAKeyFactory.toRSAKey(key);
        return rsaKey.getModulus().bitLength();
    }
View Full Code Here

Examples of java.security.interfaces.RSAKey

            if ("RAW".equals(format) && sk.getEncoded() != null) {
                size = (sk.getEncoded().length * 8);
            }   // Otherwise, it may be a unextractable key of PKCS#11, or
                // a key we are not able to handle.
        } else if (key instanceof RSAKey) {
            RSAKey pubk = (RSAKey)key;
            size = pubk.getModulus().bitLength();
        } else if (key instanceof ECKey) {
            ECKey pubk = (ECKey)key;
            size = pubk.getParams().getOrder().bitLength();
        } else if (key instanceof DSAKey) {
            DSAKey pubk = (DSAKey)key;
            size = pubk.getParams().getP().bitLength();
        } else if (key instanceof DHKey) {
            DHKey pubk = (DHKey)key;
            size = pubk.getParams().getP().bitLength();
        }   // Otherwise, it may be a unextractable key of PKCS#11, or
            // a key we are not able to handle.

        return size;
    }
View Full Code Here

Examples of l2p.gameserver.loginservercon.lspackets.RSAKey

    }
    int id = data[0] & 0xFF;
    switch(id)
    {
      case 0:
        packet = new RSAKey(data, loginserver);
        break;
      case 1:
        packet = new LoginServerFail(data, loginserver);
        break;
      case 2:
View Full Code Here

Examples of l2p.loginserver.gameservercon.lspackets.RSAKey

    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    gameserver.sendPacket(new RSAKey(gameserver.getRSAPublicKey()));
  }
View Full Code Here

Examples of marauroa.common.crypto.RSAKey

    try {
      if (Configuration.getConfiguration().get("n") == null) {
        throw new Exception("Missing RSA key pair in server.ini; run marauroa.tools.GenerateKeys");
      }
      RSAKey key = new RSAKey(new BigInteger(Configuration.getConfiguration().get("n")),
          new BigInteger(Configuration.getConfiguration().get("d")), new BigInteger(
              Configuration.getConfiguration().get("e")));

      gameMan = new GameServerManager(key, netMan, rpMan);
      gameMan.start();
View Full Code Here

Examples of marauroa.common.crypto.RSAKey

    PlayerEntryContainer.getContainer();
    loadRSAKey();
  }

  public static void loadRSAKey() {
    key = new RSAKey(new BigInteger("2408376769632966826891253753617412746862686794740723175774423430043927850498085639220684795629747326949838501777926669337171495421818563824539329224927899179237"),
        new BigInteger("2247818318324102371765170170042918563738507675091341630722795201374332660464879838332237004076252849654527963214772652641735279016325354691167883850414929419335"),
            new BigInteger("15"));
  }
View Full Code Here

Examples of marauroa.common.crypto.RSAKey

    final String keySize = getStringWithDefault("512");
    System.out.println();
    System.out.println("# Using key of " + keySize + " bits.");
    System.out.println("# Please wait while the key is generated.");
    System.out.println("# Moving your mouse around to generate randomness may speed up the process.");
    RSAKey rsakey = RSAKey.generateKey(Integer.valueOf(keySize));
    System.out.println();
    System.out.println("# Encryption key");
    rsakey.print(System.out);
    in.close();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.