當前位置: 首頁>>代碼示例>>C#>>正文


C# Interface.MonoTlsSettings類代碼示例

本文整理匯總了C#中Mono.Security.Interface.MonoTlsSettings的典型用法代碼示例。如果您正苦於以下問題:C# MonoTlsSettings類的具體用法?C# MonoTlsSettings怎麽用?C# MonoTlsSettings使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MonoTlsSettings類屬於Mono.Security.Interface命名空間,在下文中一共展示了MonoTlsSettings類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CreateSslStream

		public override IMonoSslStream CreateSslStream (
			Stream innerStream, bool leaveInnerStreamOpen,
			MonoTlsSettings settings = null)
		{
			var impl = new MNS.Private.LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
			return new MNS.Private.MonoSslStreamImpl (impl);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:7,代碼來源:OldTlsProvider.cs

示例2: CreateSslStream

		public override IMonoSslStream CreateSslStream (
			Stream innerStream, bool leaveInnerStreamOpen,
			MonoTlsSettings settings = null)
		{
			return new MonoBtlsStream (
				innerStream, leaveInnerStreamOpen, settings, this);
		}
開發者ID:sushihangover,項目名稱:playscript,代碼行數:7,代碼來源:MonoBtlsProvider.cs

示例3: CreateSslStream

		internal static MonoSslStream CreateSslStream (
			Stream innerStream, bool leaveInnerStreamOpen,
			MonoTlsProvider provider, MonoTlsSettings settings = null)
		{
			var stream = new MonoNewTlsStream (innerStream, leaveInnerStreamOpen, provider, settings);
			return new MonoSslStreamImpl (stream);
		}
開發者ID:VimalKumarS,項目名稱:mono-tls,代碼行數:7,代碼來源:MonoNewTlsStreamFactory.cs

示例4: GetInternalValidator

#pragma warning disable 618

		internal static ICertificateValidator GetInternalValidator (MonoTlsProvider provider, MonoTlsSettings settings)
		{
			if (settings == null)
				return new ChainValidationHelper (provider, null, false, null, null);
			if (settings.CertificateValidator != null)
				return settings.CertificateValidator;
			return new ChainValidationHelper (provider, settings, false, null, null);
		}
開發者ID:sushihangover,項目名稱:playscript,代碼行數:10,代碼來源:ChainValidationHelper.cs

示例5: CreateSslStream

		internal static MonoSslStream CreateSslStream (
			Stream innerStream, bool leaveInnerStreamOpen,
			ICertificateValidator certificateValidator,
			MonoTlsSettings settings = null)
		{
			var stream = new MonoNewTlsStream (innerStream, leaveInnerStreamOpen, certificateValidator, settings);
			return new MonoSslStreamImpl (stream);
		}
開發者ID:peterdocter,項目名稱:mono-tls,代碼行數:8,代碼來源:MonoNewTlsStreamFactory.cs

示例6: CreateTlsContext

		public override IMonoTlsContext CreateTlsContext (
			string hostname, bool serverMode, TlsProtocols protocolFlags,
			X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
			bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
			MonoTlsSettings settings)
		{
			throw new NotSupportedException ();
		}
開發者ID:JokerGITHUB,項目名稱:mono,代碼行數:8,代碼來源:DotNetTlsProvider.cs

示例7: GetCertificateValidator

		internal static MSI.ICertificateValidator GetCertificateValidator (ICertificateValidator validator)
		{
			if (validator == null)
				return null;

			var settings = new MSI.MonoTlsSettings ();
			settings.ServerCertificateValidationCallback = (s, c, ch, e) => {
				return ((CertificateValidator)validator).ValidationCallback (s, c, ch, (SslPolicyErrors)e);
			};
			return MSI.CertificateValidationHelper.CreateDefaultValidator (settings);
		}
開發者ID:peterdocter,項目名稱:mono-tls,代碼行數:11,代碼來源:CallbackHelpers.cs

示例8: TlsConfiguration

		public TlsConfiguration (TlsProtocols protocols, MonoTlsSettings settings, string targetHost)
		{
			supportedProtocols = protocols;
			requestedProtocol = CheckProtocol (settings, ref supportedProtocols, false);
			TlsSettings = settings;
			TargetHost = targetHost;

			if (settings != null)
				UserSettings = (UserSettings)settings.UserSettings;
			if (UserSettings == null)
				UserSettings = new UserSettings ();

			RenegotiationFlags = DefaultRenegotiationFlags;
		}
開發者ID:VimalKumarS,項目名稱:mono-tls,代碼行數:14,代碼來源:TlsConfiguration.cs

示例9: CreateClient

		public static MonoNewTlsStream CreateClient (
			Stream innerStream, bool leaveOpen, MonoTlsProvider provider, MonoTlsSettings settings,
			string targetHost, PSSCX.X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
		{
			var stream = new MonoNewTlsStream (innerStream, leaveOpen, provider, settings);

			try {
				stream.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
			} catch (Exception ex) {
				var tlsEx = stream.LastError;
				if (tlsEx != null)
					throw new AggregateException (ex, tlsEx);
				throw;
			}
			return stream;
		}
開發者ID:REALTOBIZ,項目名稱:mono,代碼行數:16,代碼來源:MonoNewTlsStreamFactory.cs

示例10: SslStream

		internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, EncryptionPolicy encryptionPolicy, MonoTlsProvider provider, MonoTlsSettings settings)
			: base (innerStream, leaveInnerStreamOpen)
		{
			if (encryptionPolicy != EncryptionPolicy.RequireEncryption && encryptionPolicy != EncryptionPolicy.AllowNoEncryption && encryptionPolicy != EncryptionPolicy.NoEncryption)
				throw new ArgumentException (SR.GetString (SR.net_invalid_enum, "EncryptionPolicy"), "encryptionPolicy");

			var validationHelper = MNS.ChainValidationHelper.CloneWithCallbackWrapper (provider, ref settings, myUserCertValidationCallbackWrapper);

			LocalCertSelectionCallback selectionCallback = null;
			if (validationHelper.HasCertificateSelectionCallback)
				selectionCallback = validationHelper.SelectClientCertificate;

			var internalProvider = new MNS.Private.MonoTlsProviderWrapper (provider);
			_Configuration = new MyConfiguration (internalProvider, settings, this);
			_SslState = new SslState (innerStream, null, selectionCallback, encryptionPolicy, _Configuration);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:16,代碼來源:SslStream.cs

示例11: CreateSslStream

		public override MonoSslStream CreateSslStream (
			Stream innerStream, bool leaveInnerStreamOpen,
			MonoTlsSettings settings = null)
		{
			if (settings != null)
				throw new NotSupportedException ("Mono-specific API Extensions not available.");

			RemoteCertificateValidationCallback validation_callback = null;
			LocalCertificateSelectionCallback selection_callback = null;

			if (settings != null) {
				validation_callback = ConvertCallback (settings.RemoteCertificateValidationCallback);
				selection_callback = ConvertCallback (settings.ClientCertificateSelectionCallback);
			}

			return new DotNetSslStreamImpl (innerStream, leaveInnerStreamOpen, validation_callback, selection_callback);
		}
開發者ID:JokerGITHUB,項目名稱:mono,代碼行數:17,代碼來源:DotNetTlsProvider.cs

示例12: SslStream

		internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, EncryptionPolicy encryptionPolicy, MonoTlsSettings settings)
			: base (innerStream, leaveInnerStreamOpen)
		{
#if MARTIN_FIXME
			if (encryptionPolicy != EncryptionPolicy.RequireEncryption && encryptionPolicy != EncryptionPolicy.AllowNoEncryption && encryptionPolicy != EncryptionPolicy.NoEncryption)
				throw new ArgumentException (SR.GetString (SR.net_invalid_enum, "EncryptionPolicy"), "encryptionPolicy");

			var validationHelper = ChainValidationHelper.CloneWithCallbackWrapper (ref settings, myUserCertValidationCallbackWrapper);

			LocalCertSelectionCallback selectionCallback = null;
			if (validationHelper.HasCertificateSelectionCallback)
				selectionCallback = validationHelper.SelectClientCertificate;

			_Configuration = new MyConfiguration (settings, this);
			_SslState = new SslState (innerStream, null, selectionCallback, encryptionPolicy, _Configuration);
#else
			throw new NotImplementedException ();
#endif
		}
開發者ID:jdgiotta,項目名稱:mono,代碼行數:19,代碼來源:SslStream.cs

示例13: CloneWithCallbackWrapper

		/*
		 * This is a hack which is used in SslStream - see ReferenceSources/SslStream.cs for details.
		 */
		internal static ChainValidationHelper CloneWithCallbackWrapper (MonoTlsProvider provider, ref MonoTlsSettings settings, ServerCertValidationCallbackWrapper wrapper)
		{
			var helper = (ChainValidationHelper)settings.CertificateValidator;
			if (helper == null)
				helper = new ChainValidationHelper (provider, settings, true, null, wrapper);
			else
				helper = new ChainValidationHelper (helper, provider, settings, wrapper);
			settings = helper.settings;
			return helper;
		}
開發者ID:sushihangover,項目名稱:playscript,代碼行數:13,代碼來源:ChainValidationHelper.cs

示例14: MonoTlsSettings

		MonoTlsSettings (MonoTlsSettings other)
		{
			RemoteCertificateValidationCallback = other.RemoteCertificateValidationCallback;
			ClientCertificateSelectionCallback = other.ClientCertificateSelectionCallback;
			checkCertName = other.checkCertName;
			checkCertRevocationStatus = other.checkCertRevocationStatus;
			UseServicePointManagerCallback = other.useServicePointManagerCallback;
			skipSystemValidators = other.skipSystemValidators;
			callbackNeedsChain = other.callbackNeedsChain;
			UserSettings = other.UserSettings;
			EnabledProtocols = other.EnabledProtocols;
			TrustAnchors = other.TrustAnchors;
			cloned = true;
		}
開發者ID:RogueRocketGames,項目名稱:mono,代碼行數:14,代碼來源:MonoTlsSettings.cs

示例15: CloneWithValidator

		public MonoTlsSettings CloneWithValidator (ICertificateValidator validator)
		{
			if (cloned) {
				this.certificateValidator = validator;
				return this;
			}

			var copy = new MonoTlsSettings (this);
			copy.certificateValidator = validator;
			return copy;
		}
開發者ID:RogueRocketGames,項目名稱:mono,代碼行數:11,代碼來源:MonoTlsSettings.cs


注:本文中的Mono.Security.Interface.MonoTlsSettings類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。