@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 HpkePrivateKey create(HpkePublicKey publicKey, SecretBytes privateKeyBytes)
      throws GeneralSecurityException {
    if (publicKey == null) {
      throw new GeneralSecurityException(
          "HPKE private key cannot be constructed without an HPKE public key");
    }
    if (privateKeyBytes == null) {
      throw new GeneralSecurityException("HPKE private key cannot be constructed without secret");
    }
    validatePrivateKeyByteLength(publicKey.getParameters().getKemId(), privateKeyBytes);
    validateKeyPair(
        publicKey.getParameters().getKemId(),
        publicKey.getPublicKeyBytes().toByteArray(),
        privateKeyBytes.toByteArray(InsecureSecretKeyAccess.get()));
    return new HpkePrivateKey(publicKey, privateKeyBytes);
  }
Creates a new HPKE private key.

@param publicKey Corresponding HPKE public key for this private key
@param privateKeyBytes Private key encoded according to
    https://www.rfc-editor.org/rfc/rfc9180.html#section-7.1.2
java_src/src/main/java/com/google/crypto/tink/hybrid/HpkePrivateKey.java