コード例 #1
0
        /// <summary>
        /// Dispose the instance
        /// </summary>
        /// <param name="bIsDisposing"></param>
        protected void Dispose(bool bIsDisposing)
        {
            // Check if we have an inbound credential
            if (_inboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _inboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release inbound credentials handle");
                }

                // Reset inbound credential
                _inboundCredential = new SecurityHandle();
            }

            // Check if we have an outbound credential
            if (_outboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _outboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release outbound credentials handle");
                }

                // Reset inbound credential
                _outboundCredential = new SecurityHandle();
            }
        }
コード例 #2
0
 static internal extern int AcceptSecurityContext(ref SecurityHandle phCredential,
                                                  ref SecurityHandle phContext,
                                                  ref SecBufferDesc pInput,
                                                  uint fContextReq,
                                                  uint TargetDataRep,
                                                  out SecurityHandle phNewContext,
                                                  out SecBufferDesc pOutput,
                                                  out uint pfContextAttr,
                                                  out SecurityInteger ptsTimeStamp);
コード例 #3
0
 static internal extern int AcquireCredentialsHandle(
     string pszPrincipal,
     string pszPackage,
     int fCredentialUse,
     IntPtr pvLogonID,
     IntPtr pAuthData,
     int pGetKeyFn,
     IntPtr pvGetKeyArgument,
     ref SecurityHandle phCredential,
     ref SecurityInteger ptsExpiry);
コード例 #4
0
ファイル: SecurityWrapper.cs プロジェクト: dotnet/corefx
 static internal extern int AcquireCredentialsHandle(
     string pszPrincipal,
     string pszPackage,
     int fCredentialUse,
     IntPtr pvLogonID,
     IntPtr pAuthData,
     int pGetKeyFn,
     IntPtr pvGetKeyArgument,
     ref SecurityHandle phCredential,
     ref SecurityInteger ptsExpiry);
コード例 #5
0
 static internal extern int InitializeSecurityContext(ref SecurityHandle phCredential,
                                                      ref SecurityHandle phContext,
                                                      string pszTargetName,
                                                      uint fContextReq,
                                                      int Reserved1,
                                                      uint TargetDataRep,
                                                      ref SecBufferDesc pInput,
                                                      int Reserved2,
                                                      out SecurityHandle phNewContext,
                                                      out SecBufferDesc pOutput,
                                                      out uint pfContextAttr,
                                                      out SecurityInteger ptsTimeStamp);
コード例 #6
0
ファイル: SecurityWrapper.cs プロジェクト: dotnet/corefx
 static internal extern int InitializeSecurityContext(ref SecurityHandle phCredential,
     ref SecurityHandle phContext,
     string pszTargetName,
     uint fContextReq,
     int Reserved1,
     uint TargetDataRep,
     ref SecBufferDesc pInput,
     int Reserved2,
     out SecurityHandle phNewContext,
     out SecBufferDesc pOutput,
     out uint pfContextAttr,
     out SecurityInteger ptsTimeStamp);
コード例 #7
0
 static internal extern int QuerySecurityContextToken(ref SecurityHandle phContext, ref IntPtr phToken);
コード例 #8
0
 static internal extern int FreeCredentialsHandle(ref SecurityHandle phCredential);
コード例 #9
0
 static internal extern int CompleteAuthToken(ref SecurityHandle phContext, out SecBufferDesc pOutput);
コード例 #10
0
ファイル: SecurityWrapper.cs プロジェクト: dotnet/corefx
 static internal extern int QuerySecurityContextToken(ref SecurityHandle phContext, ref IntPtr phToken);
コード例 #11
0
ファイル: SecurityWrapper.cs プロジェクト: dotnet/corefx
 static internal extern int FreeCredentialsHandle(ref SecurityHandle phCredential);
コード例 #12
0
ファイル: SecurityWrapper.cs プロジェクト: dotnet/corefx
 static internal extern int AcceptSecurityContext(ref SecurityHandle phCredential,
     ref SecurityHandle phContext,
     ref SecBufferDesc pInput,
     uint fContextReq,
     uint TargetDataRep,
     out SecurityHandle phNewContext,
     out SecBufferDesc pOutput,
     out uint pfContextAttr,
     out SecurityInteger ptsTimeStamp);
コード例 #13
0
ファイル: SecurityWrapper.cs プロジェクト: dotnet/corefx
 static internal extern int CompleteAuthToken(ref SecurityHandle phContext, out SecBufferDesc pOutput);
コード例 #14
0
ファイル: SSPIContext.Windows.cs プロジェクト: dotnet/corefx
        /// <summary>
        /// Dispose the instance
        /// </summary>
        /// <param name="bIsDisposing"></param>
        protected void Dispose(bool bIsDisposing)
        {
            // Check if we have an inbound credential
            if (_inboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _inboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release inbound credentials handle");
                }

                // Reset inbound credential
                _inboundCredential = new SecurityHandle();
            }

            // Check if we have an outbound credential
            if (_outboundCredential.IsValid())
            {
                // Call into security API to release the credentials
                if (SecurityWrapper.FreeCredentialsHandle(ref _outboundCredential) != (int)SecResult.Ok)
                {
                    // Throw an exception
                    throw new Exception("Failed to release outbound credentials handle");
                }

                // Reset inbound credential
                _outboundCredential = new SecurityHandle();
            }
        }