Examples of WebAPI


Examples of WebService.WebApi

        initComponents();
        this.setResizable(false);
        setContentPane(new Connexion(this));    
        this.setVisible(true);
        scores = new ArrayList<Float>();
        this.webApi = new WebApi();
    }
View Full Code Here

Examples of uk.co.thomasc.steamkit.steam3.webapi.WebAPI

  boolean authenticate(LoginKeyCallback callback) {
    sessionId = new BASE64Encoder().encode(String.valueOf(callback.getUniqueId()).getBytes());

    Util.printConsole("Got login key, performing web auth...", this, ConsoleColor.Magenta, true);

    final WebAPI userAuth = new WebAPI("ISteamUserAuth", BotInfo.getApiKey());
    // generate an AES session key
    final byte[] sessionKey = CryptoHelper.GenerateRandomBlock(32);

    // rsa encrypt it with the public key for the universe we're on
    byte[] cryptedSessionKey = null;
    final RSACrypto rsa = new RSACrypto(KeyDictionary.getPublicKey(steamClient.getConnectedUniverse()));
    cryptedSessionKey = rsa.encrypt(sessionKey);

    final byte[] loginKey = new byte[20];
    System.arraycopy(callback.getLoginKey().getBytes(), 0, loginKey, 0, callback.getLoginKey().length());

    // aes encrypt the loginkey with our session key
    final byte[] cryptedLoginKey = CryptoHelper.SymmetricEncrypt(loginKey, sessionKey);

    KeyValue authResult;

    try {
      authResult = userAuth.authenticateUser(String.valueOf(steamClient.getSteamId().convertToLong()), WebHelpers.UrlEncode(cryptedSessionKey), WebHelpers.UrlEncode(cryptedLoginKey), "POST");
    } catch (final Exception e) {
      return false;
    }

    token = authResult.get("token").asString();
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.