Beispiel #1
0
 public M3RequestMessage(string request)
 {
     //Constructor for an actual request message
     //for use as a reference or for making a real request.
     reqHeader.protocolVer = MsgInitValues.PROTOCOL;
     reqHeader.reqType     = BitConverter.GetBytes((UInt32)enMsgType.raMessage3Req);
     reqHeader.msgLength   = BitConverter.GetBytes((UInt32)enDefaultLength.raDefaultM3Length);
     reqHeader.nonce       = MsgInitValues.DS_ZERO_BA16;
     reqM3Body             = new ReqMsg3Body();
 }
Beispiel #2
0
 public M3RequestMessage()
 {
     //Constructor to populate an "empty" object with values that allow
     //dection of missing fields after deserialization.
     reqHeader.protocolVer = MsgInitValues.DS_EMPTY_BA2;
     reqHeader.reqType     = BitConverter.GetBytes((UInt32)enMsgType.raReserved);
     reqHeader.msgLength   = BitConverter.GetBytes((UInt32)enDefaultLength.raDefaultEmptyLength);
     reqHeader.nonce       = MsgInitValues.DS_ZERO_BA16;
     reqM3Body             = new ReqMsg3Body();
     reqM3Body.aesCmac     = MsgInitValues.DS_ZERO_BA16;
     reqM3Body.gaX         = MsgInitValues.DS_EMPTY_BA32;
     reqM3Body.gaY         = MsgInitValues.DS_EMPTY_BA32;
     reqM3Body.secProperty = MsgInitValues.DS_EMPTY_BA256;
     reqM3Body.quote       = MsgInitValues.DS_EMPTY_BA64;
 }
        //Build an M3 request
        public void buildM3Request(out M3RequestMessage m3Req)
        {
            string request = Constants.Request;
            var    m3Msg   = new M3RequestMessage(request);
            var    m3Body  = new ReqMsg3Body();

            m3Body.aesCmac     = Constants.sampleCmacsmk;
            m3Body.gaX         = Constants.sampleGaXba;
            m3Body.gaY         = Constants.sampleGaYba;
            m3Body.secProperty = Constants.sampleM3secProp;
            m3Body.quote       = Constants.sampleQuote;

            //load a complete message object
            m3Msg.reqM3Body = m3Body;
            m3Req           = m3Msg;
            return;
        }