MSDN Library

ConnectPackage.Create Method (Microsoft.Health.Package)

Asks HealthVault to create a pending package for the application specified by the connection with the specified user specific parameters.

Declaration Syntax

Public Shared Function Create( _
	ByVal connection As OfflineWebApplicationConnection, _
	ByVal friendlyName As String, _
	ByVal securityQuestion As String, _
	ByVal applicationPatientId As String, _
	ByVal connectPackage As PasswordProtectedPackage _
) As String
public static string Create(
	OfflineWebApplicationConnection connection, 
	string friendlyName, 
	string securityQuestion, 
	string applicationPatientId, 
	PasswordProtectedPackage connectPackage
);
public: static System.String Create(
	OfflineWebApplicationConnection connection, 
	System.String friendlyName, 
	System.String securityQuestion, 
	System.String applicationPatientId, 
	PasswordProtectedPackage connectPackage
);
public static function Create(
	connection : OfflineWebApplicationConnection, 
	friendlyName : System.String, 
	securityQuestion : System.String, 
	applicationPatientId : System.String, 
	connectPackage : PasswordProtectedPackage
) : System.String;

Parameters

connection
The application connection to HealthVault. The application ID in the connection is used when making the patient connection.  
friendlyName
A friendly name for the patient connection which will be shown to the user when they go to HealthVault Shell to validate the connection.  
securityQuestion
A question (usually provided by the patient) to which the patient must provide the securityAnswer when they go to validate the connection in the HealthVault Shell.  
applicationPatientId
The application specific identifier for the user. This identifier is used to uniquely identify the user in the application data storage whereas the HealthVault person ID is used to identify the person in HealthVault.  
connectPackage
The pending connect package that the user will add to his/her record.  

Return Value

A token that the application must give to the patient to use when validating the connection request.

Exception

Exception TypeCondition
System.ArgumentNullException If connection is null.
System.ArgumentException If friendlyName, securityQuestion, applicationPatientId, or connectPackage is null or empty.
HealthServiceException If an error occurs when contacting HealthVault.

Remarks

The password protected package supports 2 encryption algorithms, AES256 (recommended) and TripleDES.

For AES256, the supported key size is 256 bits, the blocksize is 256 bits, the IV length is 32 bytes.

For TripleDES, the supported key size is 192 bits, the blocksize is 64 bits, the IV length is 8 bytes.

The encryption key should be derived using the answer, the salt, and the number of hash iterations. The decryption will generate this key via the System.Security.Cryptography.Rfc2898DeriveBytes class, hence, encryption should use a similar or identical process. To ensure case-insensitivity, the answer should be converted to its lower cased form using System.String.ToLowerInvariant (culturally-agnostic) prior to generating the derived key.

The algorithm used has the following parameters:
  • Mode = CipherMode.CBC
  • Padding = PaddingMode.ISO10126


The salt supplied is used as the salt to the derived key as well as the key to the supplied HMAC. The salt should be at least 8 bytes long.

It is recommended that the number of hash iterations be at least 10000.

Requirements

Namespace: Microsoft.Health.Package
Assembly: Microsoft.Health (microsoft.health.dll)
Show:
© 2016 Microsoft