ClickOnce Signing


C

Chuck P

I am trying to sign a click once application vs08sp1.
I use the following batch file to generate the pfx file.

When in the project properties Sigining page I click Select From File.
I input the file and it asks for a password.
The documentation says it won't ask for a password.
http://msdn.microsoft.com/en-us/library/che5h906.aspx
Since I don't have a password, how do I proceed?

set AppName=TheNameOfYourApplication
set sourcePath="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin"
set destinationPath=c:

@echo off
cls

echo.
echo Creating Personal Information Exchange (PFX) file to hold the
encryption certificate and
echo private key needed for click once deployment.
echo Once deployed never rerun this command.
echo.
echo For password prompt enter none.
echo.
echo Press Ctrl-C to abort or
@pause

cls
echo.
echo deleting any existing files.
del %AppName%_Certificate.cer
del %AppName%_PrivateKey.pvk
del %AppName%_Exchange.pfx


echo.
echo making cert and private key
%sourcePath%\makecert -r -pe -e 01/01/2058 -n "CN=%AppName%" -sv
%AppName%_PrivateKey.pvk %AppName%_Certificate.cer


echo.
echo Making Personal Information Exchange (PFX) file
%sourcePath%\pvk2pfx.exe -pvk %AppName%_PrivateKey.pvk -spc
%AppName%_Certificate.cer -pfx %AppName%_Exchange.pfx


echo.
echo Copying (PFX) file to destination %destinationPath%
copy %AppName%_Exchange.pfx %destinationePath%\*.* /Y


echo.
echo deleting any existing files.
del %AppName%_Certificate.cer
del %AppName%_PrivateKey.pvk
del %AppName%_Exchange.pfx

echo.

@pause
 
Ad

Advertisements

Z

Zhi-Xin Ye [MSFT]

Dear Chuck,

I tested with your batch file and got the same result. It seems the
pvk2pfx.exe tool uses a default password to encypt the .pfx file if you
don't specify a password for it, I've no idea what the default password it
is. However, if we create the .pfx file through export wizard and leave
the password empty, then the .pfx would be no password protected.

You can take the following steps to try:

1. Change the this line in the batch file:

%sourcePath%\pvk2pfx.exe -pvk %AppName%_PrivateKey.pvk -spc
%AppName%_Certificate.cer -pfx %AppName%_Exchange.pfx

To

%sourcePath%\pvk2pfx.exe -pvk %AppName%_PrivateKey.pvk -spc
%AppName%_Certificate.cer

2. Execute the batch file;
3. When the "Certificate Export Wizard" dialog pops up, clicks "Next";
4. Choose "Yes, export the private key" option at "Export Private Key" step;
5. Click "Next" until it goes to the "Password" step;
6. Left the password empty and click "Next";
7. Specify a name for the .pfx file;
8. Click "Next";
9. Click "Finish".
10. Open your project, and switch to project property page, on the Signing
tab, click "Select From File..." to select the .pfx file created in the
previous steps, the .pfx file should be imported without prompting for
password;

Please try these steps and let me know the result.

Sincerely,
Zhi-Xin Ye
Microsoft Managed Newsgroup Support Team

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Ad

Advertisements

C

Chuck P

I would say the programs are way buggy.
They prompt me for the password even though I enter it on the command line.
If I don't enter it on the command line the files don't get created correctly.
I redid the batch file and this kludge around seems to work.

set AppName=WITS
set toolsPath="C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin"
set destinationPath=c:
set password=xxx


@echo off
cls


echo.
echo Creating Personal Information Exchange (PFX) file to hold the
encryption certificate and
echo private key needed for click once deployment.
echo Once deployed never rerun this command.
echo.
echo For password prompts use: %password%
echo.
echo Press Ctrl-C to abort or
@pause


cls
echo.
echo deleting any existing files.

del %AppName%_Certificate.cer
del %AppName%_PrivateKey.pvk
del %AppName%_Exchange.pfx


echo.
echo making cert and private key
%toolsPath%\makecert -r -pe -e 01/01/2058 -n "CN=%AppName%" -sv
%AppName%_PrivateKey.pvk %AppName%_Certificate.cer


echo.
echo Making Personal Information Exchange (PFX) file
%toolsPath%\pvk2pfx.exe -pvk %AppName%_PrivateKey.pvk -pi %password% -spc
%AppName%_Certificate.cer -pfx %AppName%_Exchange.pfx -po %password%


echo.
echo Copying (PFX) file to destination %destinationPath%
copy %AppName%_Exchange.pfx %destinationePath%\*.* /Y


echo.
echo deleting any existing files.

del %AppName%_Certificate.cer
del %AppName%_PrivateKey.pvk
del %AppName%_Exchange.pfx

echo.

@pause
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top