当前位置: 首页>>代码示例>>C#>>正文


C# SafeDeleteContext类代码示例

本文整理汇总了C#中SafeDeleteContext的典型用法代码示例。如果您正苦于以下问题:C# SafeDeleteContext类的具体用法?C# SafeDeleteContext怎么用?C# SafeDeleteContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SafeDeleteContext类属于命名空间,在下文中一共展示了SafeDeleteContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AcceptSecurityContext

 public void AcceptSecurityContext(SafeFreeCredentials credential, SafeDeleteContext context, Interop.SspiCli.ContextFlags inFlags)
 {
     if (IsEnabled())
     {
         AcceptSecurityContext(IdOf(credential), IdOf(context), inFlags);
     }
 }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:NetEventSource.Security.Windows.cs

示例2: InitializeSecurityContext

 public void InitializeSecurityContext(SafeFreeCredentials credential, SafeDeleteContext context, string targetName, Interop.SspiCli.ContextFlags inFlags)
 {
     if (IsEnabled())
     {
         InitializeSecurityContext(IdOf(credential), IdOf(context), targetName, inFlags);
     }
 }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:NetEventSource.Security.Windows.cs

示例3: InitializeSecurityContext

        public SecurityStatus InitializeSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer)
        {
            Interop.Secur32.ContextFlags outFlags = Interop.Secur32.ContextFlags.Zero;

            var retStatus = (SecurityStatus)SafeDeleteContext.InitializeSecurityContext(ref credential, ref context, targetName, RequiredFlags | Interop.Secur32.ContextFlags.InitManualCredValidation, Interop.Secur32.Endianness.Native, inputBuffer, null, outputBuffer, ref outFlags);

            return MapToSecurityStatus((Interop.SecurityStatus)retStatus);
        }
开发者ID:rainersigwald,项目名称:corefx,代码行数:8,代码来源:SSPISecureChannelType.cs

示例4: DecryptMessage

 public static SecurityStatusPal DecryptMessage(SafeDeleteContext securityContext, byte[] buffer, ref int offset, ref int count)
 {
     int resultSize;
     SecurityStatusPal retVal = EncryptDecryptHelper(securityContext, buffer, offset, count, 0, 0, false, out resultSize);
     if (SecurityStatusPal.OK == retVal || SecurityStatusPal.Renegotiate == retVal)
     {
         count = resultSize;
     }
     return retVal;
 }
开发者ID:jussimar,项目名称:corefx,代码行数:10,代码来源:SslStreamPal.Unix.cs

示例5: DecryptMessage

 public static SecurityStatusPal DecryptMessage(SafeDeleteContext securityContext, byte[] buffer, ref int offset, ref int count)
 {
     int resultSize;
     SecurityStatusPal retVal = EncryptDecryptHelper(securityContext, buffer, offset, count, false, ref buffer, out resultSize);
     if (retVal.ErrorCode == SecurityStatusPalErrorCode.OK || 
         retVal.ErrorCode == SecurityStatusPalErrorCode.Renegotiate)
     {
         count = resultSize;
     }
     return retVal;
 }
开发者ID:ChuangYang,项目名称:corefx,代码行数:11,代码来源:SslStreamPal.Unix.cs

示例6: EncryptMessage

        public int EncryptMessage(SafeDeleteContext context, Interop.Secur32.SecurityBufferDescriptor inputOutput, uint sequenceNumber)
        {
            int status = (int)Interop.SecurityStatus.InvalidHandle;
            bool ignore = false;

            context.DangerousAddRef(ref ignore);
            status = Interop.Secur32.EncryptMessage(ref context._handle, 0, inputOutput, sequenceNumber);
            context.DangerousRelease();

            return status;
        }
开发者ID:nnyamhon,项目名称:corefx,代码行数:11,代码来源:SSPIAuthType.cs

示例7: AcceptSecurityContext

 internal static SecurityStatus AcceptSecurityContext(SSPIInterface SecModule, ref SafeFreeCredentials credential, ref SafeDeleteContext context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, bool remoteCertRequired)
 {
     if (Logging.On)
     {
         Logging.PrintInfo(Logging.Web,
             "AcceptSecurityContext(" +
             "credential = " + credential.ToString() + ", " +
             "context = " + Logging.ObjectToString(context) + ", " +
             "remoteCertRequired = " + remoteCertRequired);
     }
     return SecModule.AcceptSecurityContext(ref credential, ref context, inputBuffer, outputBuffer, remoteCertRequired);
 }
开发者ID:nnyamhon,项目名称:corefx,代码行数:12,代码来源:_SSPIWrapper.cs

示例8: QueryContextStreamSizes

 public int QueryContextStreamSizes(SafeDeleteContext securityContext, out StreamSizes streamSizes)
 {
     streamSizes = null;
     try
     {
         streamSizes = new StreamSizes(Interop.libssl.SslSizes.HEADER_SIZE, Interop.libssl.SslSizes.TRAILER_SIZE, Interop.libssl.SslSizes.SSL3_RT_MAX_PLAIN_LENGTH);
         return 0;
     }
     catch
     {              
         return -1;
     }
 }
开发者ID:TAdityaAnirudh,项目名称:corefx,代码行数:13,代码来源:SSPISecureChannelType.cs

示例9: EncryptMessage

 public int EncryptMessage(SafeDeleteContext context, Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber)
 {
     try
     {
         bool ignore = false;
         context.DangerousAddRef(ref ignore);
         return Interop.SspiCli.EncryptMessage(ref context._handle, 0, inputOutput, sequenceNumber);
     }
     finally
     {
         context.DangerousRelease();
     }
 }
开发者ID:naamunds,项目名称:corefx,代码行数:13,代码来源:SSPISecureChannelType.cs

示例10: QueryContextConnectionInfo

        public static int QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo)
        {
            connectionInfo = null;
            try
            {
                connectionInfo = new SslConnectionInfo(securityContext.SslContext);

                return 0;
            }
            catch
            {
                return -1;
            }
        }
开发者ID:jussimar,项目名称:corefx,代码行数:14,代码来源:SslStreamPal.Unix.cs

示例11: AcceptSecurityContext

 public int AcceptSecurityContext(ref SafeFreeCredentials credential, ref SafeDeleteContext context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, bool remoteCertRequired)
 {
     Interop.Secur32.ContextFlags outFlags = Interop.Secur32.ContextFlags.Zero;
     return SafeDeleteContext.AcceptSecurityContext(
                                 ref credential,
                                 ref context,
                                 ServerRequiredFlags | (remoteCertRequired ? Interop.Secur32.ContextFlags.MutualAuth : Interop.Secur32.ContextFlags.Zero),
                                 Interop.Secur32.Endianness.Native,
                                 inputBuffer,
                                 null,
                                 outputBuffer,
                                 ref outFlags
                                 );
 }
开发者ID:nnyamhon,项目名称:corefx,代码行数:14,代码来源:SSPIAuthType.cs

示例12: DecryptMessage

 public unsafe int DecryptMessage(SafeDeleteContext context, Interop.Secur32.SecurityBufferDescriptor inputOutput,
     uint sequenceNumber)
 {
     try
     {
         bool ignore = false;
         context.DangerousAddRef(ref ignore);
         return Interop.Secur32.DecryptMessage(ref context._handle, inputOutput, sequenceNumber, null);
     }
     finally
     {
         context.DangerousRelease();
     }
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:14,代码来源:SSPISecureChannelType.cs

示例13: InitializeSecurityContext

        internal static SecurityStatus InitializeSecurityContext(SSPIInterface SecModule, SafeFreeCredentials credential, ref SafeDeleteContext context, string targetName, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer)
        {
            if (Logging.On)
            {
                Logging.PrintInfo(Logging.Web,
                    "InitializeSecurityContext(" +
                    "credential = " + credential.ToString() + ", " +
                    "context = " + Logging.ObjectToString(context) + ", " +
                    "targetName = " + targetName);
            }

            SecurityStatus errorCode = SecModule.InitializeSecurityContext(credential, ref context, targetName, inputBuffers, outputBuffer);
           
            return errorCode;
        }
开发者ID:nnyamhon,项目名称:corefx,代码行数:15,代码来源:_SSPIWrapper.cs

示例14: AcceptSecurityContext

        public static SecurityStatusPal AcceptSecurityContext(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteContext context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, bool remoteCertRequired)
        {
            Interop.SspiCli.ContextFlags unusedAttributes = default(Interop.SspiCli.ContextFlags);

            int errorCode = SSPIWrapper.AcceptSecurityContext(
                GlobalSSPI.SSPISecureChannel,
                ref credentialsHandle,
                ref context,
                ServerRequiredFlags | (remoteCertRequired ? Interop.SspiCli.ContextFlags.MutualAuth : Interop.SspiCli.ContextFlags.Zero),
                Interop.SspiCli.Endianness.Native,
                inputBuffer,
                outputBuffer,
                ref unusedAttributes);

            return GetSecurityStatusPalFromWin32Int(errorCode);
        }
开发者ID:dpvreony-forks,项目名称:corefx,代码行数:16,代码来源:SslStreamPal.Windows.cs

示例15: QueryContextConnectionInfo

 public static int QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo)
 {
     string protocolVersion;
     connectionInfo = null;
     try
     {
         Interop.libssl.SSL_CIPHER cipher = Interop.OpenSsl.GetConnectionInfo(securityContext.SslContext, out protocolVersion);
         connectionInfo =  new SslConnectionInfo(cipher, protocolVersion);
        
         return 0;
     }
     catch
     {
         return -1;
     }
 }
开发者ID:devgopher,项目名称:corefx,代码行数:16,代码来源:SslStreamPal.Unix.cs


注:本文中的SafeDeleteContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。