def METHOD_NAME(
    self, algorithm: "EncryptionAlgorithm", plaintext: bytes, iv: "Optional[bytes]" = None
) -> EncryptResult:
    self._raise_if_unsupported(KeyOperation.METHOD_NAME, algorithm)
    # If an IV isn't provided with AES-CBCPAD encryption, try to create one
    if iv is None and algorithm.value.endswith("CBCPAD"):
        try:
            iv = os.urandom(16)
        except NotImplementedError as ex:
            raise ValueError(
                "An IV could not be generated on this OS. Please provide your own cryptographically random, "
                "non-repeating IV for local cryptography."
            ) from ex
    ciphertext = self._internal_key.METHOD_NAME(plaintext, algorithm=algorithm.value, iv=iv)
    return EncryptResult(
        key_id=self._key.kid, algorithm=algorithm, ciphertext=ciphertext, iv=iv  # type: ignore[attr-defined]
    )