コード例 #1
0
ファイル: PgpUser.cs プロジェクト: 1hub/springburg
 internal PgpUser(ContainedPacket userPacket, PgpKey publicKey, PgpSignature signature)
 {
     this.userPacket = userPacket;
     //this.publicKey = publicKey;
     this.selfCertifications   = new List <PgpCertification>();
     this.otherCertifications  = new List <PgpCertification>();
     this.revocationSignatures = new List <PgpCertification>();
     AddCertification(publicKey, signature);
 }
コード例 #2
0
ファイル: PgpUser.cs プロジェクト: 1hub/springburg
 internal PgpUser(PgpUser user, PgpKey publicKey)
 {
     this.userPacket = user.userPacket;
     //this.publicKey = publicKey;
     this.selfCertifications   = new List <PgpCertification>();
     this.otherCertifications  = new List <PgpCertification>();
     this.revocationSignatures = new List <PgpCertification>();
     foreach (var certification in user.selfCertifications)
     {
         this.selfCertifications.Add(new PgpCertification(certification.Signature, userPacket, publicKey));
     }
     foreach (var certification in user.otherCertifications)
     {
         this.otherCertifications.Add(new PgpCertification(certification.Signature, userPacket, publicKey));
     }
     foreach (var certification in user.revocationSignatures)
     {
         this.revocationSignatures.Add(new PgpCertification(certification.Signature, userPacket, publicKey));
     }
 }
コード例 #3
0
ファイル: PgpUser.cs プロジェクト: 1hub/springburg
        internal PgpUser(IPacketReader packetReader, PgpKey publicKey)
        {
            Debug.Assert(packetReader.NextPacketTag() == PacketTag.UserId || packetReader.NextPacketTag() == PacketTag.UserAttribute);

            //this.publicKey = publicKey;
            this.userPacket  = packetReader.ReadContainedPacket();
            this.trustPacket = packetReader.NextPacketTag() == PacketTag.Trust ? (TrustPacket)packetReader.ReadContainedPacket() : null;

            selfCertifications   = new List <PgpCertification>();
            otherCertifications  = new List <PgpCertification>();
            revocationSignatures = new List <PgpCertification>();

            while (packetReader.NextPacketTag() == PacketTag.Signature)
            {
                var signaturePacket      = (SignaturePacket)packetReader.ReadContainedPacket();
                var signatureTrustPacket = packetReader.NextPacketTag() == PacketTag.Trust ? (TrustPacket)packetReader.ReadContainedPacket() : null;
                var signature            = new PgpSignature(signaturePacket, signatureTrustPacket);
                AddCertification(publicKey, signature);
            }
        }
コード例 #4
0
 public void WritePacket(ContainedPacket packet)
 {
     // The only packets that should be writtern here are the streamable ones
     // or nested signature.
     if (packet is OnePassSignaturePacket && !generator.onePassWritten)
     {
         // Nested signature, write our one-pass packet first
         WriteOnePassSignature(true);
         innerWriter.WritePacket(packet);
     }
     else if (packet is SignaturePacket)
     {
         Debug.Assert(generator.onePassWritten);
         Debug.Assert(generator.literalDataWritten);
         innerWriter.WritePacket(packet);
     }
     else
     {
         throw new InvalidOperationException();
     }
 }
コード例 #5
0
 public void WritePacket(ContainedPacket p)
 {
     p.Encode(this);
 }
コード例 #6
0
 public void WritePacket(ContainedPacket packet) => packetWriter.WritePacket(packet);