Пример #1
0
 public ChallengeResponse(string respond)
 {
     respHeader.protocolVer  = MsgInitValues.PROTOCOL;
     respHeader.respStatus   = BitConverter.GetBytes((UInt32)enStatusCodes.raErrNone);
     respHeader.respType     = BitConverter.GetBytes((UInt32)enMsgType.raChallengeResp);
     respHeader.msgLength    = BitConverter.GetBytes((UInt32)enDefaultLength.raDefaultCrespLength);
     respHeader.sessionNonce = MsgInitValues.DS_ZERO_BA16;
     cRespBody = new ResponseChallengeMsgBody();
 }
Пример #2
0
 public ChallengeResponse()
 {
     //Constructor to populate an "empty" object
     respHeader.protocolVer  = MsgInitValues.DS_EMPTY_BA2;
     respHeader.respStatus   = BitConverter.GetBytes((UInt32)enStatusCodes.raErrUnknown);
     respHeader.respType     = BitConverter.GetBytes((UInt32)enMsgType.raReserved);
     respHeader.msgLength    = BitConverter.GetBytes((UInt32)enDefaultLength.raDefaultEmptyLength);
     respHeader.sessionNonce = MsgInitValues.DS_ZERO_BA16;
     cRespBody = new ResponseChallengeMsgBody();
 }
        //Build a challenge response message
        public void buildChallengeResponse(out ChallengeResponse cMResp)
        {
            string respond = Constants.Respond;
            var    cMsg    = new ChallengeResponse(respond);

            //populate the message object with header and body components
            var cMsgBody = new ResponseChallengeMsgBody();

            cMsg.respHeader.sessionNonce = Constants.sn1;
            cMsg.cRespBody = cMsgBody;

            //assign a return object reference
            cMResp = cMsg;
            return;
        }