/// <summary>
		/// Acquires security credentials for a current security principal
		/// </summary>
		public SecurityCredentials AcquireSecurityCredentials(
			SecurityCredentialsType credType,
			IDictionary authData)
		{
			// prepare context usage
			uint credUsage = 0;
			if ((credType & SecurityCredentialsType.InBound) != 0)
				credUsage |= SSPINative.SECPKG_CRED_INBOUND;
			if ((credType & SecurityCredentialsType.OutBound) != 0)
				credUsage |= SSPINative.SECPKG_CRED_OUTBOUND;

			// prepare identity information
			SSPINative.SecWinNTAuthIdentity authIdentity = new SSPINative.SecWinNTAuthIdentity();
			if (authData != null)
			{
				string userName = (string)authData["user"];
				if (userName != null)
				{
					authIdentity.User = userName;
					authIdentity.UserLength = userName.Length;
				}
				string domain = (string)authData["domain"];
				if (domain != null)
				{
					authIdentity.Domain = domain;
					authIdentity.DomainLength = domain.Length;
				}
				string password = (string)authData["password"];
				if (password != null)
				{
					authIdentity.Password = password;
					authIdentity.PasswordLength = password.Length;
				}
			}

			// acquire credentials
			Int64 credHandle;
			Int64 credExpiry;

			int error = SSPINative.AcquireCredentialsHandle(
				null,
				_secPackage.Name,
				credUsage,
				IntPtr.Zero,
				authIdentity,
				IntPtr.Zero,
				IntPtr.Zero,
				out credHandle,
				out credExpiry);
			if (error < 0)
				throw new SSPIException(Marshal.GetLastWin32Error(), "Could not acquire credentials handle");

			// create credentials object
			return new SecurityCredentials(_secPackage, credHandle, credExpiry, credType);
		}
        /// <summary>
        /// Acquires security credentials for a current security principal
        /// </summary>
        public SecurityCredentials AcquireSecurityCredentials(
            SecurityCredentialsType credType,
            IDictionary authData)
        {
            // prepare context usage
            uint credUsage = 0;

            if ((credType & SecurityCredentialsType.InBound) != 0)
            {
                credUsage |= SSPINative.SECPKG_CRED_INBOUND;
            }
            if ((credType & SecurityCredentialsType.OutBound) != 0)
            {
                credUsage |= SSPINative.SECPKG_CRED_OUTBOUND;
            }

            // prepare identity information
            SSPINative.SecWinNTAuthIdentity authIdentity = new SSPINative.SecWinNTAuthIdentity();
            if (authData != null)
            {
                string userName = (string)authData["user"];
                if (userName != null)
                {
                    authIdentity.User       = userName;
                    authIdentity.UserLength = userName.Length;
                }
                string domain = (string)authData["domain"];
                if (domain != null)
                {
                    authIdentity.Domain       = domain;
                    authIdentity.DomainLength = domain.Length;
                }
                string password = (string)authData["password"];
                if (password != null)
                {
                    authIdentity.Password       = password;
                    authIdentity.PasswordLength = password.Length;
                }
            }

            // acquire credentials
            Int64 credHandle;
            Int64 credExpiry;

            int error = SSPINative.AcquireCredentialsHandle(
                null,
                _secPackage.Name,
                credUsage,
                IntPtr.Zero,
                authIdentity,
                IntPtr.Zero,
                IntPtr.Zero,
                out credHandle,
                out credExpiry);

            if (error < 0)
            {
                throw new SSPIException(Marshal.GetLastWin32Error(), "Could not acquire credentials handle");
            }

            // create credentials object
            return(new SecurityCredentials(_secPackage, credHandle, credExpiry, credType));
        }