IPassportCrypt::put_Host
IPassportCrypt::put_Host
Sets the key being used by the current Passport Crypt object by referring to the host name or IP number being used by the desired installation. This property should be used only if your site has multiple keys installed because there are multiple sites being served by common Passport Manager installations.
Syntax
HRESULT put_Host( BSTR bstrHostName );
Parameters
- bstrHostName
[in] A BSTR that matches the IP or name of the host address to which a key was first installed. To determine the host being used by a current page, you can use the Active Server Pages (ASP) Request.ServerVariables("SERVER_NAME") method or ISAPI or lower-level equivalents. Host names assigned to sites are also visible in the Passport Manager Administration utility.
Return values
Returns one of the following values:
S_OK Success. E_OUTOFMEMORY Could not allocate memory for a copy string.
Remarks
Setting keys for the Passport Crypt object has no effect whatsoever on the keys used for Ticket and Profile decryption by the Passport Manager object. The Passport Manager object loads the key for the current request either by determining host name through ASP objects (through the built-in OnStartPage) or through the structures passed to equivalent Passport Manager ISAPI-targeted application programming interfaces (APIs).
put_Host might be used for ISAPI because the Passport Crypt object will not be calling the built-in OnStartPage method that sets the key for the current host request when operating through ASP. Thus, the correct host or site name must be determined and then set as a property in order to assure that the Passport Crypt object is working in the correct key. put_Host can be used to deliberately set the current Passport Crypt object's key to a value other than that which corresponds to the current request. A site might do this in cases in which Passport Crypt objects are being used to encrypt and exchange private data intra-site using only one of the site's keys as the master, or in which the Passport Crypt object was established in application or session scope and thus cannot determine host of the current connection.
See Also