code: public static EcKey fromJsonWebKey(JsonWebKey jwk, boolean includePrivateParameters, Provider provider) {
          try {
              if (jwk.kid() != null) {
                  return new EcKey(jwk.kid(), jwk.toEC(includePrivateParameters, provider));
              } else {
                  throw new IllegalArgumentException("Json Web Key should have a kid");
              }
          } catch (GeneralSecurityException e) {
              throw new IllegalStateException(e);
          }
      }
docs: Converts JSON web key to EC key pair and include the private key if set to true.
  @param jwk
  @param includePrivateParameters true if the EC key pair should include the private key. False otherwise.
  @param provider the Java Security Provider
  @return EcKey