def block_encrypt(key, block, cek = nil, iv = nil)
      jwe = self
      if cek.nil?
        cek, jwe = next_cek(key)
      end
      iv ||= jwe.next_iv
      aad, plain_text = block
      if plain_text.nil?
        plain_text = aad
        aad = nil
      end
      encrypted_key, jwe = jwe.key_encrypt(key, cek)
      protected_binary = JOSE.urlsafe_encode64(jwe.to_binary)
      if aad.nil?
        cipher_text, cipher_tag = enc.block_encrypt([protected_binary, jwe.compress(plain_text)], cek, iv)
        return JOSE::EncryptedMap[
          'ciphertext'    => JOSE.urlsafe_encode64(cipher_text),
          'encrypted_key' => JOSE.urlsafe_encode64(encrypted_key),
          'iv'            => JOSE.urlsafe_encode64(iv),
          'protected'     => protected_binary,
          'tag'           => JOSE.urlsafe_encode64(cipher_tag)
        ]
      else
        aad_b64 = JOSE.urlsafe_encode64(aad)
        concat_aad = [protected_binary, '.', aad_b64].join
        cipher_text, cipher_tag = enc.block_encrypt([concat_aad, jwe.compress(plain_text)], cek, iv)
        return JOSE::EncryptedMap[
          'aad'           => aad_b64,
          'ciphertext'    => JOSE.urlsafe_encode64(cipher_text),
          'encrypted_key' => JOSE.urlsafe_encode64(encrypted_key),
          'iv'            => JOSE.urlsafe_encode64(iv),
          'protected'     => protected_binary,
          'tag'           => JOSE.urlsafe_encode64(cipher_tag)
        ]
      end
    end
def block_encrypt(key, block, cek = nil, iv = nil)
      jwe = self
      if cek.nil?
        cek, jwe = next_cek(key)
      end
      iv ||= jwe.next_iv
      aad, plain_text = block
      if plain_text.nil?
        plain_text = aad
        aad = nil
      end
      encrypted_key, jwe = jwe.key_encrypt(key, cek)
      protected_binary = JOSE.urlsafe_encode64(jwe.to_binary)
      if aad.nil?
        cipher_text, cipher_tag = enc.block_encrypt([protected_binary, jwe.compress(plain_text)], cek, iv)
        return JOSE::EncryptedMap[
          'ciphertext'    => JOSE.urlsafe_encode64(cipher_text),
          'encrypted_key' => JOSE.urlsafe_encode64(encrypted_key),
          'iv'            => JOSE.urlsafe_encode64(iv),
          'protected'     => protected_binary,
          'tag'           => JOSE.urlsafe_encode64(cipher_tag)
        ]
      else
        aad_b64 = JOSE.urlsafe_encode64(aad)
        concat_aad = [protected_binary, '.', aad_b64].join
        cipher_text, cipher_tag = enc.block_encrypt([concat_aad, jwe.compress(plain_text)], cek, iv)
        return JOSE::EncryptedMap[
          'aad'           => aad_b64,
          'ciphertext'    => JOSE.urlsafe_encode64(cipher_text),
          'encrypted_key' => JOSE.urlsafe_encode64(encrypted_key),
          'iv'            => JOSE.urlsafe_encode64(iv),
          'protected'     => protected_binary,
          'tag'           => JOSE.urlsafe_encode64(cipher_tag)
        ]
      end
    end
Encrypts the `block` binary using the `key`, `cek`, and `iv`.
 @see JOSE::JWE.block_encrypt
 @param [JOSE::JWK, [JOSE::JWK, JOSE::JWK]] key
 @param [String, [String, String]] block
 @param [String] cek
 @param [String] iv
 @return [JOSE::EncryptedMap]