Show TOC

Building and Running a Windows ProjectLocate this document in the navigation structure

Build and run a Windows project for an X.509 certificate provider.

Context

This task references the sample provider project. Alternately, you can use these steps to build your own certificate provider project. The sample FileCertificateProvider project example is available for download at https://github.com/SAP/mobilesdk-certificateproviderInformation published on non-SAP site in Windows/ExampleSP09AndBeyond.cs.

Procedure

  1. Create a Cordova application and add:
    • Windows platform
    • Logon plugin
  2. Import the SampleFileCertificateProvider project into Visual Studio.
    Note
    • The solution automatically migrates to all supported Windows versions.
    • Ensure that there are no Windows 8.0 version projects.

    Or,

    To setup your own provider implementation, copy the content of SampleFileCertificateProvider to the Windows platform directory.

  3. Add the SampleFileCertificateProvider sample project to the solution.Right-click and select Add Existing Project > SampleFileCertificateProvider.csproj
  4. Add the interface definition reference in the SampleFileCertificateProvider as the sample provider implements the interface shipped in the Kapsel drop. To add the reference:
    1. Right-click References and select Add Reference
    2. Click Browse and select SAP.CertificateProvider.winmd from the following path: kapsel drop\plugins\logon\windows<version>\bin
  5. Setup references to use the SampleFileCertificateProvider in an app (for both CordovaApp.Windows and device). To add the reference:
    1. Right-click References and select Add Reference > solution/project > SampleFileCertificateProvider
    2. Ensure that the project and build dependencies are correct, the SampleFileCertificateProvider is built before the app.
  6. Add necessary HTML/metadata resources to the app. To add resources to the app:
    1. Copy the index.html file from the CertificateProviderCordovaSample folder and paste in the app's platform\windows\www folder (overwrite the existing file)
    2. Add AppMetadata.json file to the app project (CordovaApp.Windows and Phone) to load a proper provider class
      Sample Code Ensure that the content is as follows:
      {"com.sap.certProviderClass":"SAP.Sample.CertificateProvider.FileCertificateProvider,SampleFileCertificateProvider,ContentType=WindowsRuntime"}
      Sample Code Set the properties as follows:
      Package Action=Resource
      Copy to Output Directory=Do not copy
    3. Copy and add the your *.p12 file to the project.
      Sample Code Set the properties as follows:
      Package Action=content
      Copy to Output Directory=Copy Always
  7. Build and run the project.
    1. Click Logon.
    2. Click SendRequest