Esempio n. 1
0
 public Stream GetPacketStream(StreamablePacket packet)
 {
     if (!generator.onePassWritten)
     {
         WriteOnePassSignature(false);
     }
     if (packet is LiteralDataPacket)
     {
         // TODO: Version 5 signatures
         var packetStream = innerWriter.GetPacketStream(packet);
         generator.literalDataWritten = true;
         return(new CryptoStream(packetStream, hashTransform, CryptoStreamMode.Write));
     }
     else
     {
         return(innerWriter.GetPacketStream(packet));
     }
 }
        /// <summary>
        /// Open a literal data packet.
        /// </summary>
        /// <param name="writer">The writer we want the packet in.</param>
        /// <param name="format">The format we are using.</param>
        /// <param name="name">The name of the 'file'.</param>
        /// <param name="modificationTime">The time of last modification we want stored.</param>
        public PgpLiteralMessageGenerator(
            IPacketWriter writer,
            PgpDataFormat format,
            string name,
            DateTime modificationTime)
        {
            if (writer == null)
            {
                throw new ArgumentNullException(nameof(writer));
            }

            var packet = new LiteralDataPacket(format, name, modificationTime);

            this.outputStream = writer.GetPacketStream(packet);
            this.writer       = writer;
        }
Esempio n. 3
0
 public Stream GetPacketStream(StreamablePacket packet) => packetWriter.GetPacketStream(packet);