コード例 #1
0
        public AppleTlsContext(
            MobileAuthenticatedStream parent, MonoTlsSettings settings,
            AppleTlsProvider provider, bool serverMode, string targetHost,
            SSA.SslProtocols enabledProtocols, X509Certificate serverCertificate,
            X509CertificateCollection clientCertificates, bool askForClientCert)
        {
            this.parent             = parent;
            this.settings           = settings;
            this.provider           = provider;
            this.serverMode         = serverMode;
            this.targetHost         = targetHost;
            this.enabledProtocols   = enabledProtocols;
            this.serverCertificate  = serverCertificate;
            this.clientCertificates = clientCertificates;
            this.askForClientCert   = askForClientCert;

            handle       = GCHandle.Alloc(this);
            connectionId = GCHandle.ToIntPtr(handle);
            readFunc     = NativeReadCallback;
            writeFunc    = NativeWriteCallback;

            certificateValidator = CertificateValidationHelper.GetDefaultValidator(settings, provider);

            if (IsServer)
            {
                if (serverCertificate == null)
                {
                    throw new ArgumentNullException("serverCertificate");
                }
            }
        }
コード例 #2
0
        public AppleTlsContext(
            MobileAuthenticatedStream parent, MonoTlsSettings settings,
            AppleTlsProvider provider, bool serverMode, string targetHost,
            SSA.SslProtocols enabledProtocols, X509Certificate serverCertificate,
            X509CertificateCollection clientCertificates, bool askForClientCert)
        {
            this.parent = parent;
            this.settings = settings;
            this.provider = provider;
            this.serverMode = serverMode;
            this.targetHost = targetHost;
            this.enabledProtocols = enabledProtocols;
            this.serverCertificate = serverCertificate;
            this.clientCertificates = clientCertificates;
            this.askForClientCert = askForClientCert;

            handle = GCHandle.Alloc (this);
            connectionId = GCHandle.ToIntPtr (handle);
            readFunc = NativeReadCallback;
            writeFunc = NativeWriteCallback;

            // a bit higher than the default maximum fragment size
            readBuffer = new byte [16384];
            writeBuffer = new byte [16384];

            certificateValidator = CertificateValidationHelper.GetDefaultValidator (settings, provider);

            if (IsServer) {
                if (serverCertificate == null)
                    throw new ArgumentNullException ("serverCertificate");
            }
        }
コード例 #3
0
        public AppleTlsContext(
            MobileAuthenticatedStream parent, bool serverMode, string targetHost,
            SSA.SslProtocols enabledProtocols, X509Certificate serverCertificate,
            X509CertificateCollection clientCertificates, bool askForClientCert)
            : base(parent, serverMode, targetHost, enabledProtocols,
                   serverCertificate, clientCertificates, askForClientCert)
        {
            handle       = GCHandle.Alloc(this);
            connectionId = GCHandle.ToIntPtr(handle);
            readFunc     = NativeReadCallback;
            writeFunc    = NativeWriteCallback;

            if (IsServer)
            {
                if (serverCertificate == null)
                {
                    throw new ArgumentNullException("serverCertificate");
                }
            }
        }
コード例 #4
0
 public AsyncProtocolRequest(MobileAuthenticatedStream parent, LazyAsyncResult lazyResult, BufferOffsetSize userBuffer = null)
 {
     Parent          = parent;
     UserAsyncResult = lazyResult;
     UserBuffer      = userBuffer;
 }
コード例 #5
0
 internal static MobileTlsStream CreateTlsStream(MobileAuthenticatedStream parent, MonoTlsSettings settings, MobileTlsProvider provider, bool serverMode, string targetHost, SslProtocols enabledProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
 {
     return(new AppleTlsContext(parent, settings, provider, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, clientCertRequired));
 }
コード例 #6
0
 public AsyncProtocolRequest(MobileAuthenticatedStream parent, LazyAsyncResult lazyResult, BufferOffsetSize userBuffer = null)
 {
     Parent = parent;
     UserAsyncResult = lazyResult;
     UserBuffer = userBuffer;
 }
コード例 #7
0
 internal static MobileTlsStream CreateTlsStream(MobileAuthenticatedStream parent, MonoTlsSettings settings, MobileTlsProvider provider, bool serverMode, string targetHost, SslProtocols enabledProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, bool clientCertRequired)
 {
     return new AppleTlsContext (parent, settings, provider, serverMode, targetHost, enabledProtocols, serverCertificate, clientCertificates, clientCertRequired);
 }