Context: .NET MVC 5 Site
I have a need to have application level encryption so that all files that end up on the file system are encrypted.
This is working well, and files that go through the IStorageProvider instances end up encrypted on disk.
But other related files do not. I think they are being created by the DocumentCache class.
But I don't see a way to hook into the cache generation like I can by implementing IStorageProvider by wrapping LocalFileStorage
For example, given this setup
Viewer.SetRootStoragePath("C:\viewer-cache\root\", "C:\viewer-cache\working\");
Viewer.SetStorageProvider(
new EncryptedLocalStorageProvider(root),
new EncryptedLocalStorageProvider(working));
And a call like this in my cshtml
var helper = Html.ViewerClientCode().TargetElementSelector("#doc-viewer-viewer")
.ShowDownload(false)
.ShowFolderBrowser(false)
.ShowPrint(false)
.ZoomToFitHeight(Model.ViewerOptions.ZoomToFitHeight)
.ZoomToFitWidth(Model.ViewerOptions.ZoomToFitWidth)
.ShowThumbnails(Model.ViewerOptions.ShowThumbnails)
.OpenThumbnails(Model.ViewerOptions.OpenThumbnails)
.ShowPaging(Model.ViewerOptions.ShowPaging)
.ShowViewerStyleControl(Model.ViewerOptions.ShowViewerStyleControl);
helper.Url(Url.ContentAbsolute("~/Content/Images/no-document-selected.png"))
I end up with the following files on disk
Not Encrypted
C:\viewer-cache\root\temp\FromURL\http___localhost_Content_Images_no-document-selected
C:\viewer-cache\working\Cache\temp\FromURL\http___localhost_Content_Images_no-document-selected.png\2015-07-20T20_21_33\100@150x.Pdf\page_0.jpg
C:\viewer-cache\working\Cache\temp\FromURL\http___localhost_Content_Images_no-document-selected.png\2015-07-20T20_21_33\100@852x.Pdf\page_0.jpg
C:\viewer-cache\working\Cache\temp\FromURL\http___localhost_Content_Images_no-document-selected.png\2015-07-20T20_21_33\100@x.Pdf\page_0.jpg
Encrypted
C:\viewer-cache\working\temp\FromURL\http___localhost_Content_Images_no-document-selected.png\2015-07-20T20_21_33\100@150x.Pdf\page_0.jpg
C:\viewer-cache\working\temp\FromURL\http___localhost_Content_Images_no-document-selected.png\2015-07-20T20_21_33\100@852x.Pdf\page_0.jpg
C:\viewer-cache\working\temp\FromURL\http___localhost_Content_Images_no-document-selected.png\2015-07-20T20_21_33\100@x.Pdf\page_0.jpg
I had expected all file access to go through the IStorageProvider instances given to Viewer.SetStorageProvider, but this doesn't seem to be the case.
What else can I do (via code) to make sure all files are encrypted?
Does the DocumentCache not use the tempStorageProvider that is passed into Viewer.SetStorageProvider?