@AccessesPartialKey
  private static HpkeKemPrivateKey createHpkeKemPrivateKey(HpkePrivateKey privateKey)
      throws GeneralSecurityException {
    HpkeParameters.KemId kemId = privateKey.getParameters().getKemId();
    if (kemId.equals(HpkeParameters.KemId.DHKEM_X25519_HKDF_SHA256)) {
      return X25519HpkeKemPrivateKey.fromBytes(
          privateKey.getPrivateKeyBytes().toByteArray(InsecureSecretKeyAccess.get()));
    }
    if (kemId.equals(HpkeParameters.KemId.DHKEM_P256_HKDF_SHA256)
        || kemId.equals(HpkeParameters.KemId.DHKEM_P384_HKDF_SHA384)
        || kemId.equals(HpkeParameters.KemId.DHKEM_P521_HKDF_SHA512)) {
      return NistCurvesHpkeKemPrivateKey.fromBytes(
          privateKey.getPrivateKeyBytes().toByteArray(InsecureSecretKeyAccess.get()),
          privateKey.getPublicKey().getPublicKeyBytes().toByteArray(),
          nistHpkeKemToCurve(kemId));
    }
    throw new GeneralSecurityException("Unrecognized HPKE KEM identifier");
  }
Hybrid Public Key Encryption (HPKE) decryption.

<p>HPKE RFC: https://www.rfc-editor.org/rfc/rfc9180.html
java_src/src/main/java/com/google/crypto/tink/hybrid/internal/HpkeDecrypt.java