Beispiel #1
0
        public ByteData PullData(long offset, int size)
        {
            if (offset != 0L || (long)size < this.Size)
            {
                throw new ArgumentException();
            }
            ByteData byteData = this.m_source.PullData(offset, size);

            if ((long)byteData.Buffer.Count != this.Size)
            {
                throw new InvalidOperationException();
            }
            for (int index = 0; index < 2; ++index)
            {
                byte[] array1;
                if (this.m_signer[index] != null)
                {
                    ISigner             signer = this.m_signer[index];
                    ArraySegment <byte> buffer = byteData.Buffer;
                    byte[] array2 = buffer.Array;
                    buffer = byteData.Buffer;
                    int offset1 = buffer.Offset;
                    buffer = byteData.Buffer;
                    int count = buffer.Count;
                    array1 = signer.SignBlock(array2, offset1, count);
                }
                else
                {
                    array1 = new byte[this.m_rsaValueSink[index].Size];
                }
                this.m_rsaValueSink[index].PushData(new ByteData(new ArraySegment <byte>(array1, 0, array1.Length)), 0L);
            }
            return(byteData);
        }
Beispiel #2
0
        private void SignTicket(ISigner signer)
        {
            byte[] numArray          = new byte[1024];
            int    ticketDataForSign = TicketPublication.GetTicketDataForSign(numArray, 1024U, this.m_TicketData, (uint)this.m_TicketDataLength);

            byte[] signatureBuffer = signer.SignBlock(numArray, 0, ticketDataForSign);
            TicketPublication.SignTicket(this.m_TicketData, (uint)this.m_TicketDataLength, signatureBuffer, signatureBuffer.Length);
        }