LaunchFileAsync and CRT (certificate) file extension

Mareks Malnačs 1 Reputation point
2021-05-12T14:18:46.443+00:00

Is there an option to let user see (eg open) what's inside CRT file by using winrt::Windows::System::Launcher::LaunchFileAsync() API in Windows store app? App is reading certificate (DER encoded) from the server, storing it into a temporary file using winrt::Windows::Storage::FileIO API (into winrt::Windows::Storage::ApplicationData::Current().TemporaryFolder(). At present LaunchFileAsync is getting access denied error. Only workaround I've found is to use winrt::Windows::System::Launcher::LaunchFolderAsync() to show that folder to user and let It double click on that crt file. It would be nice to let LaunchFileAsync open certificate view window instead.

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AryaDing-MSFT 2,916 Reputation points
    2021-05-13T06:23:05.097+00:00

    Hi,

    Welcome to MicroSoft Q&A!

    To solved the access denied issue, you could use StorageFile.GetFileFromApplicationUriAsync(Uri) method to get the file. As follows:

       private async void Button_Click(object sender, RoutedEventArgs e)  
        {             
            var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appdata:///temp/mycrt.crt"));  
             
        }  
    

    Note that LaunchFileAsync API also imposes several restrictions on what types of files it can launch. Many file types that contain executable code, for example .exe, .msi, and .js files, are blocked from launching. Maybe the certification file can't be launched.

    Updated:

    I have checked the related properties about Launcher, I have to say that there is no such launcher properties and app permission setting that could launch built-in certificate viewer to open this certification.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Mareks Malnačs 1 Reputation point
    2021-05-23T14:47:51.037+00:00

    Unfortunately as there is no winrt api to let me show certificate content to the user or launch Windows builtin certificate viewer there is no answer to mark. We can close this subject.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.