docs: public PublicKey verifyIdentity(byte[] sharedSecret) throws IOException, GeneralSecurityException {
          try {
              String serverKeyAlgorithm = readUTF();
              PublicKey spk = KeyFactory.getInstance(serverKeyAlgorithm).generatePublic(readKey());
  
              // verify the identity of the server
              Signature sig = Signature.getInstance("SHA1with"+serverKeyAlgorithm);
              sig.initVerify(spk);
              sig.update(spk.getEncoded());
              sig.update(sharedSecret);
              sig.verify((byte[]) readObject());
  
              return spk;
          } catch (ClassNotFoundException e) {
              throw new Error(e); // impossible
          }
      }