@AccessesPartialKey
  @RestrictedApi(
      explanation = "Accessing parts of keys can produce unexpected incompatibilities, annotate the function with @AccessesPartialKey",
      link = "https://developers.google.com/tink/design/access_control#accessing_partial_keys",
      allowedOnPath = ".*Test\\.java",
      allowlistAnnotations = {AccessesPartialKey.class})
  public static EciesPrivateKey createForNistCurve(
      EciesPublicKey publicKey, SecretBigInteger nistPrivateKeyValue)
      throws GeneralSecurityException {
    if (publicKey == null) {
      throw new GeneralSecurityException(
          "ECIES private key cannot be constructed without an ECIES public key");
    }
    if (publicKey.getNistCurvePoint() == null) {
      throw new GeneralSecurityException(
          "ECIES private key for NIST curve cannot be constructed with X25519-curve public key");
    }
    if (nistPrivateKeyValue == null) {
      throw new GeneralSecurityException("ECIES private key cannot be constructed without secret");
    }
    validateNistPrivateKeyValue(
        nistPrivateKeyValue.getBigInteger(InsecureSecretKeyAccess.get()),
        publicKey.getNistCurvePoint(),
        publicKey.getParameters().getCurveType());

    return new EciesPrivateKey(publicKey, nistPrivateKeyValue, null);
  }
Creates a new ECIES private key using NIST Curves.

@param publicKey Corresponding ECIES public key for this private key
@param nistPrivateKeyValue private big integer value in bigendian representation
java_src/src/main/java/com/google/crypto/tink/hybrid/EciesPrivateKey.java