private static void validatePrivateValue(
      BigInteger privateValue, ECPoint publicPoint, JwtEcdsaParameters.Algorithm algorithm)
      throws GeneralSecurityException {
    BigInteger order = algorithm.getECParameterSpec().getOrder();
    if ((privateValue.signum() <= 0) || (privateValue.compareTo(order) >= 0)) {
      throw new GeneralSecurityException("Invalid private value");
    }
    ECPoint p =
        EllipticCurvesUtil.multiplyByGenerator(privateValue, algorithm.getECParameterSpec());
    if (!p.equals(publicPoint)) {
      throw new GeneralSecurityException("Invalid private value");
    }
  }
Represents a key for computing JWT ECDSA signatures (ES256, ES384, ES512).

<p>See https://datatracker.ietf.org/doc/html/rfc7518 for more information.
java_src/src/main/java/com/google/crypto/tink/jwt/JwtEcdsaPrivateKey.java