/// <summary>
        /// Constructs an instance of the SspiClientSecurityContext class.
        /// </summary>
        /// <param name="keyProvider_SspiClient">Parent factory to get settings from.</param>
        public SspiClientSecurityContext(KeyProvider_SspiClient keyProvider_SspiClient)
        {
            // write settings
            this.KeyProvider_SspiClient = keyProvider_SspiClient;

//			// WAS:
//			// get credentials handle
//			SspiApi.AcquireCredentialsHandle(keyProvider_SspiClient.AuthIdentity,
//				keyProvider_SspiClient.PackageName, SspiApi.SECPKG_CRED_OUTBOUND,
//				this._credHandle, ref this._ptsExpiry);


            if (this.KeyProvider_SspiClient.DelegatedContext == null)
            {
                // get credentials handle
                SspiApi.AcquireCredentialsHandle(keyProvider_SspiClient.AuthIdentity,
                                                 keyProvider_SspiClient.PackageName, SspiApi.SECPKG_CRED_BOTH,
                                                 this._credHandle, ref this._ptsExpiry);
            }
            else
            {
                SspiApi.AcquireCredentialsHandle(keyProvider_SspiClient.AuthIdentity,
                                                 keyProvider_SspiClient.PackageName, SspiApi.SECPKG_CRED_BOTH,
                                                 this._credHandle, ref this._ptsExpiry);
            }
        }
        /// <summary>
        /// Constructs an instance of the SspiServerSecurityContext class.
        /// </summary>
        /// <param name="keyProvider_SspiServer">Parent KeyProvider_SspiServer factory.</param>
        public SspiServerSecurityContext(KeyProvider_SspiServer keyProvider_SspiServer)
        {
            this.KeyProvider_SspiServer = keyProvider_SspiServer;

            // get credentials handle
            SspiApi.AcquireCredentialsHandle(null,
                                             this.KeyProvider_SspiServer.PackageName, SspiApi.SECPKG_CRED_INBOUND,
                                             this._credHandle, ref this._ptsExpiry);
        }