@Override
  public void engineInitRecipient(byte[] encapsulated, PrivateKey recipientKey,
          byte[] info, PublicKey senderKey, byte[] psk, byte[] psk_id) throws InvalidKeyException {
    checkNotInitialised();
    checkArgumentsForBaseModeOnly(senderKey, psk, psk_id);
    Preconditions.checkNotNull(encapsulated, "null encapsulated data");
    if (encapsulated.length != hpkeSuite.getKem().getEncapsulatedLength()) {
      throw new InvalidKeyException("Invalid encapsulated length: " + encapsulated.length);
    }

    if (recipientKey == null) {
      throw new InvalidKeyException("null recipient key");
    } else if (!(recipientKey instanceof OpenSSLX25519PrivateKey)) {
      throw new InvalidKeyException("Unsupported recipient key class: " + recipientKey.getClass());
    }
    final byte[] recipientKeyBytes = ((OpenSSLX25519PrivateKey) recipientKey).getU();

    ctx = (NativeRef.EVP_HPKE_CTX) NativeCrypto.EVP_HPKE_CTX_setup_base_mode_recipient(
            hpkeSuite, recipientKeyBytes, encapsulated, info);
  }
Implementation of {@link HpkeSpi}.  Should not be used directly, but rather by one
of the subclasses of {@link HpkeContext}.
common/src/main/java/org/conscrypt/HpkeImpl.java