none
PHP API, Application ID, private key, public key - wrong response

    Question

  • Hello HealthVault experts,

    Once again I am stumped.  I have a HealthVault app created with the PHP API.  As long as I use the app.id, app.fp (public key), and app.pem (private key) included with the demo, everything works fine.  The CCD file on the healthvault-ppe server is retrieved and a nice report is generated by my app.

    But when I replace app.fp with virtualhuman.id, virtualhuman.fp, and virtualhuman.pem, this is the xml that is returned:

    <response><status><code>0</code></status><wc:info xmlns:wc="urn:com.microsoft.wc.methods.response.GetThings3"><group><filtered>true</filtered></group></wc:info></response>
    No errors, just the wrong response.  It's as if it went to some other healthvault account and didn't find a ccd.xml file.

    Has anyone been able to use the PHP API successfully using your own app.id, app.fp and app.pem?

    Here is how I created them:

    virtualhuman.id is the application id that was created by the HealthVault Application Configuration Center (ACC).

    virtualhuman.fp is the value in the Public Certs tab of the ACC

    virtualhuman.pem was generated by the following process:

    1. Run C:\Users\Greg\Documents\Health Records\Microsoft HealthVault\SDK\Tools\ComputerCertificates.msc

    2. Right click on WildcatApp-b0aa6ede-44b4-453d-b58e-8f64b1c2e8b4 and selecting "All Tasks > Export..."

    3. This brings up the Certificate Export Wizard.  Click Next.  Select "Yes, export the private key".  Click Next.

    4. Select Personal Information Exchange - PKCS #12(.PFX) and "Include all certificates in the certification path if possible".  Click Next.

    5. Enter a password.  Click Next. 

    6. Enter "virtualhuman.pfx" for the filename.  Click Next.

    7. Click Finish.

    8. Download and install OpenSSL for Windows. Convert virtualhuman.pfx to virtualhuman.pem by:

      a. put virtualhuman.pfx into c:\OpenSSL-Win32\bin

      b. Open command prompt and cd to c:\OpenSSL\bin

      c. enter "openssl pkcs12 -in virtualhuman.pfx -out temp.pem -nodes" (without quotes)

      d. enter password

      e. Response is "MAC verified OK". temp.pem now exists

      f. Copy all characters starting with "-----BEGIN PRIVATE KEY-----" and ending with "-----END PRIVATE KEY-----" to a new file called virtualhuman.pem.  Put that file on the server.

    I also created the certificate for the Microsoft go-live team as follows:

    1. Run C:\Users\Greg\Documents\Health Records\Microsoft HealthVault\SDK\Tools\ComputerCertificates.msc

    2. Right click on WildcatApp-b0aa6ede-44b4-453d-b58e-8f64b1c2e8b4 and selecting "All Tasks > Export..."

    3. This brings up the Certificate Export Wizard.  Click Next.  Select "No, do not export the private key".  Click Next.

    4. Select DER encoded binary X.509 (.CER).  Click Next.

    5. Enter virtualhuman.cer for the filename.

    6. Email virtualhuman.cer to the Microsoft Go-Live team.







    • Edited by bluebutton Friday, April 18, 2014 2:57 PM
    Thursday, April 17, 2014 5:11 PM

Answers