code: protected byte[] getSharedSecret(byte[] publicKeyBytes, KeyAgreement agreement) {
          BigInteger otherPublicKeyInt = new BigInteger(1, publicKeyBytes);
          try {
              KeyFactory keyFactory = KeyFactory.getInstance("DH");
              KeySpec otherPublicKeySpec = new DHPublicKeySpec(otherPublicKeyInt, RTMPHandshake.DH_MODULUS, RTMPHandshake.DH_BASE);
              PublicKey otherPublicKey = keyFactory.generatePublic(otherPublicKeySpec);
              agreement.doPhase(otherPublicKey, true);
          } catch (Exception e) {
              log.error("Exception getting the shared secret", e);
          }
          byte[] sharedSecret = agreement.generateSecret();
          log.debug("Shared secret [{}]: {}", sharedSecret.length, Hex.encodeHexString(sharedSecret));
          return sharedSecret;
      }
docs: Determines the validation scheme for given input.
  
  @param publicKeyBytes public key bytes
  @param agreement key agreement
  @return shared secret bytes if client used a supported validation scheme