Пример #1
0
        internal override void SetProtocolOp(Asn1ProtocolOp op)
        {
            var bindRequest = op.BindRequest = new Asn1BindRequest
            {
                Version        = Version,
                Name           = Name.GetBytes(),
                Authentication = new Asn1AuthenticationChoice()
            };

            if (Simple.HasValue)
            {
                bindRequest.Authentication.Simple = Simple.Value;
            }
            else if (SaslMechanism != null)
            {
                var sasl = new Asn1SaslCredentials
                {
                    Mechanism   = SaslMechanism.LdapString(),
                    Credentials = SaslCredentials
                };
                bindRequest.Authentication.Sasl = sasl;
            }
        }