Пример #1
0
        public static ChannelBinding?QueryContextChannelBinding(
            SafeDeleteContext securityContext,
            ChannelBindingKind attribute)
        {
            if (attribute == ChannelBindingKind.Endpoint)
            {
                return(EndpointChannelBindingToken.Build(securityContext));
            }

            throw new NotImplementedException(nameof(QueryContextChannelBinding));
        }
Пример #2
0
        public static ChannelBinding?QueryContextChannelBinding(
            SafeDeleteContext securityContext,
            ChannelBindingKind attribute)
        {
            if (attribute == ChannelBindingKind.Endpoint)
            {
                return(EndpointChannelBindingToken.Build(securityContext));
            }

            // Android doesn't expose the Finished messages, so a Unique binding token cannot be built.
            // Return null for not supported kinds
            return(null);
        }
Пример #3
0
        public static ChannelBinding QueryContextChannelBinding(
            SafeDeleteContext securityContext,
            ChannelBindingKind attribute)
        {
            switch (attribute)
            {
            case ChannelBindingKind.Endpoint:
                return(EndpointChannelBindingToken.Build(securityContext));
            }

            // SecureTransport doesn't expose the Finished messages, so a Unique binding token
            // cannot be built.
            //
            // Windows/netfx compat says to return null for not supported kinds (including unmapped enum values).
            return(null);
        }
Пример #4
0
        public static ChannelBinding QueryContextChannelBinding(SafeDeleteContext securityContext, ChannelBindingKind attribute)
        {
            ChannelBinding bindingHandle;

            if (attribute == ChannelBindingKind.Endpoint)
            {
                bindingHandle = EndpointChannelBindingToken.Build(securityContext);

                if (bindingHandle == null)
                {
                    throw Interop.OpenSsl.CreateSslException(SR.net_ssl_invalid_certificate);
                }
            }
            else
            {
                bindingHandle = Interop.OpenSsl.QueryChannelBinding(
                    ((SafeDeleteSslContext)securityContext).SslContext,
                    attribute);
            }

            return(bindingHandle);
        }