Пример #1
0
        public bool ParseClientHello(string clientHelloData)
        {
            if (Step == HandshakeResourceType.ClientHello)
            {
                var regexPattern = "[{\\\"\\w:]GeneratorClientHello[\\\\\\\":]*([\\d\\w]*)";
                var requestData  = Regex.Match(clientHelloData, regexPattern).Groups[1].Value;

                var parsed = _spcApi.ParseClientHello(Pin, clientHelloData);
                Step = HandshakeResourceType.ServerAck;
                return(parsed);
            }

            return(false);
        }
Пример #2
0
        public AckAuthData(string authType, string pin, string data, SPCApiBridge spiApi)
        {
            var regexPattern = "[{\\\"\\w:]GeneratorClientHello[\\\\\\\":]*([\\d\\w]*)";
            var requestData  = Regex.Match(data, regexPattern).Groups[1].Value;

            var regexRequestPattern = "[{\\\"\\w:]request_id[\\\\\\\":]*([\\d\\w]*)";
            var requestId           = Regex.Match(data, regexRequestPattern).Groups[1].Value;

            AuthType = authType;

            var parsed = spiApi.ParseClientHello(pin, requestData);

            if (parsed)
            {
                RequestId = requestId;
                Ack       = spiApi.GenerateServerAck();
            }
        }