How to generate a .pfx certificate for Flutter windows MSIX lib?

Sahaj Rana
2 min readMar 6, 2021

--

https://dribbble.com/shots/3305658-Keys

So let’s dive right in.

When I was in a need to build the Flutter windows app and ship it to users, I came across MSIX Installer.
It helps you publish your windows app on Windows Store as well as a direct installer package, which indeed is a lifesaver.

So here are the steps

  1. You would need to download OpenSSL to generate your certificates
    Download here.
  2. Go to where you installed the OpenSSL. In my case, it is:
    C:\Program Files\OpenSSL-Win64\bin
  3. Run cmd from this folder, that it looks like this in cmd.
    C:\Program Files\OpenSSL-Win64\bin>
    or
    make “C:\Program Files\OpenSSL-Win64\bin” a environment variable to access “OpenSSL” anywhere.
  4. Now, it’s the cmd time! Type the following.

a). Generate a private key.

openssl genrsa -out mykeyname.key 2048

b). Generate a CSR file with the help of the private key.

openssl req -new -key mykeyname.key -out mycsrname.csr

c). Generate a CRT file with the help of the private key & CSR file.

openssl x509 -in mycsrname.csr -out mycrtname.crt -req -signkey mykeyname.key -days 365

d). Generate .pfx file (finally) with the help of the private key & CRT file.

openssl pkcs12 -export -out CERTIFICATE.pfx -inkey mykeyname.key -in mycrtname.crt

There you have you .pfx certificate.

--

--

No responses yet