Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateSecureCredential()

static unsafe global.Interop.SspiCli.SCHANNEL_CRED System.Net.Security.SslStreamPal.CreateSecureCredential ( global::Interop::SspiCli::SCHANNEL_CRED::Flags flags,
int protocols,
EncryptionPolicy policy )
inlinestaticprivate

Definition at line 335 of file SslStreamPal.cs.

336 {
337 global::Interop.SspiCli.SCHANNEL_CRED sCHANNEL_CRED = default(global::Interop.SspiCli.SCHANNEL_CRED);
338 sCHANNEL_CRED.hRootStore = IntPtr.Zero;
339 sCHANNEL_CRED.aphMappers = IntPtr.Zero;
340 sCHANNEL_CRED.palgSupportedAlgs = IntPtr.Zero;
341 sCHANNEL_CRED.paCred = null;
342 sCHANNEL_CRED.cCreds = 0;
343 sCHANNEL_CRED.cMappers = 0;
344 sCHANNEL_CRED.cSupportedAlgs = 0;
345 sCHANNEL_CRED.dwSessionLifespan = 0;
346 sCHANNEL_CRED.reserved = 0;
347 sCHANNEL_CRED.dwVersion = 4;
348 global::Interop.SspiCli.SCHANNEL_CRED result = sCHANNEL_CRED;
349 switch (policy)
350 {
351 case EncryptionPolicy.RequireEncryption:
352 result.dwMinimumCipherStrength = 0;
353 result.dwMaximumCipherStrength = 0;
354 break;
355 case EncryptionPolicy.AllowNoEncryption:
356 result.dwMinimumCipherStrength = -1;
357 result.dwMaximumCipherStrength = 0;
358 break;
359 case EncryptionPolicy.NoEncryption:
360 result.dwMinimumCipherStrength = -1;
361 result.dwMaximumCipherStrength = -1;
362 break;
363 default:
364 throw new ArgumentException(System.SR.Format(System.SR.net_invalid_enum, "EncryptionPolicy"), "policy");
365 }
366 result.dwFlags = flags;
367 result.grbitEnabledProtocols = protocols;
368 return result;
369 }
static string net_invalid_enum
Definition SR.cs:40
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7

References System.SR.Format(), System.SR.net_invalid_enum, and System.IntPtr.Zero.

Referenced by System.Net.Security.SslStreamPal.AcquireCredentialsHandleSchannelCred().