Beispiel #1
0
        /// <summary>
        /// The function enables the server component of a transport application to establish a security context
        /// between the server and a remote client.
        /// </summary>
        /// <param name="inToken">The token to be used in context.</param>
        /// <exception cref="ArgumentException">
        /// invalid packet type of inToken, must be NEGOTIATE or AUTHENTICATE
        /// </exception>
        public override void Accept(byte[] inToken)
        {
            // if connectionless
            if (inToken == null)
            {
                AcceptNegotiatePacket(null);
                return;
            }

            NlmpEmptyPacket packet = new NlmpEmptyPacket(inToken);

            if (packet.Header.MessageType == MessageType_Values.NEGOTIATE)
            {
                AcceptNegotiatePacket(new NlmpNegotiatePacket(inToken));
            }
            else if (packet.Header.MessageType == MessageType_Values.AUTHENTICATE)
            {
                AcceptAuthenticatePacket(new NlmpAuthenticatePacket(inToken));

                this.needContinueProcessing = false;
            }
            else
            {
                throw new ArgumentException(
                          "invalid packet type of inToken, must be NEGOTIATE or AUTHENTICATE", "inToken");
            }
        }
 /// <summary>
 /// copy constructor.
 /// </summary>
 public NlmpEmptyPacket(
     NlmpEmptyPacket stackPacket
     )
     : base(stackPacket)
 {
 }
        /// <summary>
        /// The function enables the server component of a transport application to establish a security context
        /// between the server and a remote client.
        /// </summary>
        /// <param name="inToken">The token to be used in context.</param>
        /// <exception cref="ArgumentException">
        /// invalid packet type of inToken, must be NEGOTIATE or AUTHENTICATE
        /// </exception>
        public override void Accept(byte[] inToken)
        {
            // if connectionless
            if (inToken == null)
            {
                AcceptNegotiatePacket(null);
                return;
            }

            NlmpEmptyPacket packet = new NlmpEmptyPacket(inToken);
            if (packet.Header.MessageType == MessageType_Values.NEGOTIATE)
            {
                AcceptNegotiatePacket(new NlmpNegotiatePacket(inToken));
            }
            else if (packet.Header.MessageType == MessageType_Values.AUTHENTICATE)
            {
                AcceptAuthenticatePacket(new NlmpAuthenticatePacket(inToken));

                this.needContinueProcessing = false;
            }
            else
            {
                throw new ArgumentException(
                    "invalid packet type of inToken, must be NEGOTIATE or AUTHENTICATE", "inToken");
            }
        }
Beispiel #4
0
 /// <summary>
 /// copy constructor.
 /// </summary>
 public NlmpEmptyPacket(
     NlmpEmptyPacket stackPacket
     )
     : base(stackPacket)
 {
 }