ClickOnce deployment - using certificates

Why do own certificate, certificate VS automatically created only a year, if they can not change the time of release 2017 release

Ok

Then we create a new certificate of their own

1. Generate a certificate file my.cer with makecert command, and comes with a key my.pvk. Enter the following command (vs developers command window)

makecert -r -n "CN="test" -b 06/25/2019 -e 06/25/2100 -sv my.pvk my.cer

enter password

 

 

Click the OK button, and then pop up a window, note that the above that different, that is to create a password above, the following is the password you just created to create a certificate. I just set up a 1, so here still have to enter 1, do not enter the wrong password, or you want to start all over again

 

ps: -r parameter represents the self-signed, it means to own a certificate from the book, be sure to add -r, -n is the name of the certificate, usually your name or your company's name, to begin with CN, format CN = <your name>

-b certificate is valid start date in the format mm / dd / yyyy, pay attention, do not wrong, even if you do not write is January 1, should be written 01; -e expiration date of the certificate is valid, the format as before.

-sv is to create a key file, the file name * .pvk, -sv to add, later you will find useful.

The last is the name of the certificate file, the file name * .cer.

 

 

2. The certificates are generated, but you will see VS to the .pfx file, not a .cer file, so we have to convert, but no tool can be a place, so that we in turn two tool to convert.

 

First with cert2spc, convert files to .spc .cer file, do not ask why, to step back into you will know why .spc files. Continue to enter the command line:

Cert2spc my.cer my.spc

3. The last one, we will .pfx certificate of completion. The final step is to .pvk documents into .pfx file. So with pvk2pfx, continue to enter the following command at the command line:

pvk2pfx -pvk my.pvk -spc my.spc -pfx my.pfx -pi 1 -po 1 -f

4.my.pfx is the certificate we generated

 

Import Certificate

 

On the "Trusted Publishers" section also imported once in the same way. Then we'll publish a ClickOnce deployment package, now the real ClickOnce, a click on the automatic installation, no security suggests

 

Guess you like

Origin www.cnblogs.com/qian-520/p/11096326.html