none
怎样才能运行: Wi-Fi hotspot authentication sample ? RRS feed

答案

    • Launch Powershell elevated.
    • Use the Powershell command “Import-Module” to load the psd1 file.
    • That will add the cmdlets “Install-TestEVCert” (to generate a new signing certificate) and “ConvertTo-SignedXml” (to use the cert for signing an XML file).

    • 用管理员打开Powershell, run as asmin
    • 输入命令 Import-Module "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\ProvisioningTestHelper.psd1" 加载模块
    • 输入 Install-TestEVCert 生成新的签名证书
    • 打开IE,打开Internet选项,打开Content,点击Certificates 找到个人Personal的证书,找到刚生成安装的 MBATestCert证书
    • 同时你也可以在根证书列表中找到刚生成的根证书 MBAPTestRootCert
    • 然后找到你的 Wi-Fi hotspot authentication sample 中的 ProvisioningData.xml,将其用 ConvertTo-SignedXml 签名
    • 将此文件作为输入,证书MBAPTestCert作为签名证书进行签名
    • 如下:

    PS C:\users\v-bobbao\desktop> ConvertTo-SignedXml

    cmdlet ConvertTo-SignedXml at command pipeline position 1
    Supply values for the following parameters:
    (Type !? for Help.)
    InputFile: C:\...\ProvisioningData.xml
    OutputFile: C:\...\test.xml
    CertName: MBAPTestCert
    Loading xml file ...
    Successfully loaded file: C:\Users\v-bobbao\Desktop\Windows 8 Release Preview Metro style app samples\Wi-Fi hotspot auth
    entication sample\C#\HotspotAuthenticationApp\ProvisioningData.xml
    Retrieving certificate ...
    Successfully retrieved certificate
    Generating signature ...
    Successfully generated signature
    Successfully added signature to xml
    Saved output file: test.xml

    • 然后你就可以使用生成的一签名的test.xml了。

    详细信息,参考 http://msdn.microsoft.com/en-us/library/windows/hardware/hh770516.aspx


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    2012年7月17日 3:05
    版主

全部回复

    • Launch Powershell elevated.
    • Use the Powershell command “Import-Module” to load the psd1 file.
    • That will add the cmdlets “Install-TestEVCert” (to generate a new signing certificate) and “ConvertTo-SignedXml” (to use the cert for signing an XML file).

    • 用管理员打开Powershell, run as asmin
    • 输入命令 Import-Module "C:\Program Files (x86)\Windows Kits\8.0\bin\x86\ProvisioningTestHelper.psd1" 加载模块
    • 输入 Install-TestEVCert 生成新的签名证书
    • 打开IE,打开Internet选项,打开Content,点击Certificates 找到个人Personal的证书,找到刚生成安装的 MBATestCert证书
    • 同时你也可以在根证书列表中找到刚生成的根证书 MBAPTestRootCert
    • 然后找到你的 Wi-Fi hotspot authentication sample 中的 ProvisioningData.xml,将其用 ConvertTo-SignedXml 签名
    • 将此文件作为输入,证书MBAPTestCert作为签名证书进行签名
    • 如下:

    PS C:\users\v-bobbao\desktop> ConvertTo-SignedXml

    cmdlet ConvertTo-SignedXml at command pipeline position 1
    Supply values for the following parameters:
    (Type !? for Help.)
    InputFile: C:\...\ProvisioningData.xml
    OutputFile: C:\...\test.xml
    CertName: MBAPTestCert
    Loading xml file ...
    Successfully loaded file: C:\Users\v-bobbao\Desktop\Windows 8 Release Preview Metro style app samples\Wi-Fi hotspot auth
    entication sample\C#\HotspotAuthenticationApp\ProvisioningData.xml
    Retrieving certificate ...
    Successfully retrieved certificate
    Generating signature ...
    Successfully generated signature
    Successfully added signature to xml
    Saved output file: test.xml

    • 然后你就可以使用生成的一签名的test.xml了。

    详细信息,参考 http://msdn.microsoft.com/en-us/library/windows/hardware/hh770516.aspx


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    2012年7月17日 3:05
    版主
  • 根据simple附带的description.html文件的说明:

    Mobile broadband operators: Modify the sample to use an unsigned Provisioning Metadata XML file
    1. Open HotspotAuthenticationApp\Initialization.xaml.cs (or Initialization.xaml.cpp, or js\initialization.js) in Visual Studio
    2. Locate the call to the ProvisioningAgent constructor:
      // Create ProvisiongAgent Object 
      var provisioningAgent = new ProvisioningAgent();
      
      
    3. Replace this with a call to the privileged ProvisioningAgent interface:
      // Create ProvisiongAgent Object 
      var accountIds = Windows.Networking.NetworkOperators.MobileBroadbandAccount.AvailableNetworkAccountIds;
      
      if( accountIds.Count == 0 ) {
        // Throw Exception here; metadata not correctly installed
      }
      
      // For simplicity, using the first account ID.
      var provisioningAgent = Windows.Networking.NetworkOperators.ProvisioningAgent.CreateFromNetworkAccountId(accountIds[0]); 

    是可以通过修改代码,使用未签名的xml文件,但是,这个代码替换后,出现语法错误。

    其实,实际项目中,是要求使用未签名xml文件的,因为不同用户的SSID是不同的,这个不能写死在xml里面,再签名起来。

    2012年12月19日 8:07