Inheritance: Springburg.Cryptography.OpenPgp.Packet.Packet
Exemple #1
0
        public void WritePacket(ContainedPacket packet)
        {
            if (currentPacketStream != null)
            {
                throw new InvalidOperationException("Streamable packet is currently being written");
            }

            using var packetStream = new PacketOutputStream(this, stream, packet.Tag, canBePartial: false, preferOldFormat: preferOldFormat);
            currentPacketStream    = packetStream;
            packet.Encode(packetStream);
        }
Exemple #2
0
        public void WritePacket(ContainedPacket packet)
        {
            if (packet == null)
            {
                throw new ArgumentNullException(nameof(packet));
            }

            if (packet is OnePassSignaturePacket onePassSignaturePacket && useClearText && this.writer == null)
            {
                string hashName = PgpUtilities.GetDigestName(onePassSignaturePacket.HashAlgorithm);
                hashHeaders = hashHeaders ?? new List <string>();
                hashHeaders.Add(hashName);
                inClearText = true;
            }