docs: function (data) {
          //we're expecting this to be run twice at least
          //once with data, and once without
  
          var that = this;
          if (!data) {
              if (this._socketTimeout) {
                  clearTimeout(this._socketTimeout);  //just in case
              }
  
              //waiting on data.
              this._socketTimeout = setTimeout(function () {
                  that.handshakeFail("read_coreid timed out");
              }, 30 * 1000);
  
              return;
          }
          clearTimeout(this._socketTimeout);      // *phew*
  
          //server should read 256 bytes
          //decrypt msg using server private key
  
          var plaintext;
          try {
              plaintext = CryptoLib.decrypt(CryptoLib.getServerKeys(), data);
          }
          catch (ex) {
              logger.error("Handshake decryption error: ", ex);
          }
          if (!plaintext || (plaintext == '')) {
              that.handshakeFail("decryption failed");
              return;
          }
  
          //logger.log("read_coreid decrypted to ", plaintext.toString('hex'));
  
          //success
          //plaintext should be 52 bytes, else fail
          if (plaintext.length < (Handshake.NONCE_BYTES + Handshake.ID_BYTES)) {
  			that.handshakeFail("plaintext was too small: " + plaintext.length);
              return;
          }
  
          var vNonce = new Buffer(40);
          var vCoreID = new Buffer(12);
  
          plaintext.copy(vNonce, 0, 0, 40);
          plaintext.copy(vCoreID, 0, 40, 52);
  
  		if (plaintext.length > (Handshake.NONCE_BYTES + Handshake.ID_BYTES)) {
  			var coreKey = new Buffer(plaintext.length - 52);
  			plaintext.copy(coreKey, 0, 52, plaintext.length);
  			//console.log("got key ", coreKey.toString('hex'));
  			this.coreProvidedPem = utilities.convertDERtoPEM(coreKey);
  		}
  
          //nonces should match
          if (!utilities.bufferCompare(vNonce, that.nonce)) {
              that.handshakeFail("nonces didn't match");
              return;
          }
  
          //sweet!
          that.coreID = vCoreID.toString('hex');
          //logger.log("core reported coreID: " + that.coreID);
  
          that.stage++;
          that.nextStep();
      }