Encode() public method

public Encode ( BcpgOutputStream bcpgOut ) : void
bcpgOut BcpgOutputStream
return void
Beispiel #1
0
        public override void Encode(BcpgOutputStream bcpgOut)
        {
            MemoryStream     memoryStream     = new MemoryStream();
            BcpgOutputStream bcpgOutputStream = new BcpgOutputStream(memoryStream);

            bcpgOutputStream.WriteByte((byte)this.version);
            bcpgOutputStream.WriteLong(this.keyId);
            bcpgOutputStream.WriteByte((byte)this.algorithm);
            for (int num = 0; num != this.data.Length; num++)
            {
                MPInteger.Encode(bcpgOutputStream, this.data[num]);
            }
            bcpgOut.WritePacket(PacketTag.PublicKeyEncryptedSession, memoryStream.ToArray(), true);
        }
        public override void Encode(
            BcpgOutputStream bcpgOut)
        {
            MemoryStream     bOut = new MemoryStream();
            BcpgOutputStream pOut = new BcpgOutputStream(bOut);

            pOut.WriteByte((byte)version);

            pOut.WriteLong(keyId);

            pOut.WriteByte((byte)algorithm);

            for (int i = 0; i != data.Length; i++)
            {
                MPInteger.Encode(pOut, data[i]);
            }

            bcpgOut.WritePacket(PacketTag.PublicKeyEncryptedSession, bOut.ToArray(), true);
        }