コード例 #1
0
        public RegisterRequest(byte[] challengeParameter, byte[] applicationParameter)
        {
            var stream = new MemoryStream();

            using (var writer = new DataWriter(stream))
            {
                writer.WriteBytes(challengeParameter);
                writer.WriteBytes(applicationParameter);
            }

            Body    = stream.ToArray();
            Header  = new CommandHeader(ins: CommandCode.Register, dataLength: Body.Length);
            Trailer = new CommandTrailer(noBody: false);
        }
コード例 #2
0
        public AuthenticationRequest(byte[] challengeParameter, byte[] applicationParameter, byte[] keyHandle,
                                     Control control)
        {
            var stream = new MemoryStream();

            using (var writer = new DataWriter(stream))
            {
                writer.WriteBytes(challengeParameter);
                writer.WriteBytes(applicationParameter);
                writer.WriteByte((byte)keyHandle.Length);
                writer.WriteBytes(keyHandle);
            }

            Body    = stream.ToArray();
            Header  = new CommandHeader(ins: CommandCode.Authenticate, p1: (byte)control, dataLength: Body.Length);
            Trailer = new CommandTrailer(noBody: true);
        }