AaltoTLS.HandshakeLayer.Protocol.HandshakeStream.ConfirmEndOfStream C# (CSharp) Метод

ConfirmEndOfStream() публичный Метод

public ConfirmEndOfStream ( ) : void
Результат void
        public void ConfirmEndOfStream()
        {
            if (_reader.BaseStream.Length != _reader.BaseStream.Position) {
                throw new AlertException(AlertDescription.IllegalParameter,
                                         "HandshakeStream has unexpected data after end of packet");
            }
        }

Usage Example

Пример #1
0
        protected override void DecodeDataBytes(ProtocolVersion version, byte[] data)
        {
            CertificateList.Clear();

            MemoryStream    memStream   = new MemoryStream(data);
            HandshakeStream stream      = new HandshakeStream(memStream);
            int             certsLength = (int)stream.ReadUInt24();

            int readBytes = 0;

            while (readBytes < certsLength)
            {
                int    certLength = (int)stream.ReadUInt24();
                byte[] certBytes  = stream.ReadBytes(certLength);
                readBytes += 3 + certLength;

                CertificateList.Add(new X509Certificate(certBytes));
            }
            if (readBytes != certsLength)
            {
                throw new AlertException(AlertDescription.IllegalParameter,
                                         "Certificate total length doesn't match contents");
            }
            stream.ConfirmEndOfStream();
        }
All Usage Examples Of AaltoTLS.HandshakeLayer.Protocol.HandshakeStream::ConfirmEndOfStream