2011-07-28 22 views
1

一些背景信息微軟的HealthVault證書基於PHP應用

我的工作是應該用微軟的HealthVault交互的PHP應用程序。我能夠從https://sourceforge.net/projects/healthvaultphp/下載健康保險庫庫並獲取存儲在我的healthvault測試帳戶中的數據。

現在圖書館來了「沙箱」app.id,app.cer等所有的身份驗證的東西。所以我遇到的問題是如何獲得我的PHP應用程序的實時證書。我從微軟下載makecert.exe文件爲我生成一個證書,但它與healthvaultphp庫中包含的文本文件相比生成了一個二進制文件。

我的問題

如何以及什麼應該進入下面的文件?

認證/ app.cer

認證/ app.fp

認證/ app.pem

回答

1

我完全忘了,我已經張貼在這裏這個問題...以下是我如何解決這個問題:

微軟的HealthVault設置在PHP 需要的文件:

app.pem 
    RSA private key 
app.cer 
    Certificate file 
app.id 
    Application ID 
app.fp 
    Application thumbprint 

生成PEM和CER文件

Download and install Microsoft Healthvault SDK 
    http://msdn.microsoft.com/en-us/healthvault/bb688183 
    Install as an administrator 
Once installed create new application 
    Click ‘Create New Application’ button 
    Uncheck ‘Automatially…website…application’ box 
    Click ‘Create and Register application’ button 
    It will create a certificate name ‘WildcatApp-<appid>’ 
     app.id will contain <appid> 
    At this point you can click on the ‘HealthVault Application Configuration Center’ link and setup your HealthVault application. 
Generate the PFX file 
    Right-click on your ‘Certificate Name’ 
    Click ‘Export public and private keys (.pfx)’ menu item 
    Select the desired location for the .pfx file, preferably in third_party/microsoftHealthVault/authentication 
Converting PFX file to certificate and private key files 
    Do this in your linux vm, you should at this point have access to .pfx file because you put in location mentioned on 3.c 
    You will need to use ‘openssl’ to do the next steps 
    Generate app.cer 
     openssl pkcs12 -in <filename>.pfx -clcerts -nokeys -out app.cer 
     press ‘enter’ when asked for ‘import password’ 
     This file should only contain text starting at ---BEGIN CERTIFICATE--- to ----END CERTIFICATE---- everything before and after should be deleted 
     Now you have app.cer file 
    Generate app.pem 
     openssl pkcs12 -in <filename>.pfx -out app_enc.pem –nocerts 
     press ‘enter’ when asked for ‘import password’ 
     type in your host windows login password for ‘PEM pass phrase’ 
     This will generate an encrypted private key file 
     The encrypted private key file needs to be unencrypted to be able to use in the application 
     openssl rsa -in app_enc.pem -out app.pem 
     Now you have the app.pem file 
Log in to your healthvault configuration screen to get the app id and thumbprint 
    https://config.healthvault-ppe.com/default.aspx 
    Copy the ‘Application Id’ and insert it in the app.id file 
    Click on the ‘Application Id’ 
    Click on the ‘Public certs’ tab 
    Copy the ‘Thumbprint’ and insert it in the app.fp file 

此時你app.cer,app.pem,app.id和app.fp文件是隨時可以使用。

HealthVault的應用程序配置 https://config.healthvault-ppe.com/default.aspx

的HealthVault開發人員中心 http://msdn.microsoft.com/en-us/healthvault/bb688183

HealthVault的事情定義 http://developer.healthvault.com/types/types.aspx