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

public GetEncodedContents ( ) : byte[]
Результат byte[]
Пример #1
0
        public byte[] GetEncodedContents()
        {
            MemoryStream     bOut = new MemoryStream();
            BcpgOutputStream pOut = new BcpgOutputStream(bOut);

            pOut.Write(pubKeyPacket.GetEncodedContents());

            pOut.WriteByte((byte)s2kUsage);

            if (s2kUsage == UsageChecksum || s2kUsage == UsageSha1)
            {
                pOut.WriteByte((byte)encAlgorithm);
                pOut.WriteObject(s2k);
            }

            if (iv != null)
            {
                pOut.Write(iv);
            }

            if (secKeyData != null && secKeyData.Length > 0)
            {
                pOut.Write(secKeyData);
            }

            return(bOut.ToArray());
        }
Пример #2
0
        public byte[] GetEncodedContents()
        {
            //IL_0000: Unknown result type (might be due to invalid IL or missing references)
            //IL_0006: Expected O, but got Unknown
            MemoryStream     val = new MemoryStream();
            BcpgOutputStream bcpgOutputStream = new BcpgOutputStream((Stream)(object)val);

            bcpgOutputStream.Write(pubKeyPacket.GetEncodedContents());
            ((Stream)bcpgOutputStream).WriteByte((byte)s2kUsage);
            if (s2kUsage == 255 || s2kUsage == 254)
            {
                ((Stream)bcpgOutputStream).WriteByte((byte)encAlgorithm);
                bcpgOutputStream.WriteObject(s2k);
            }
            if (iv != null)
            {
                bcpgOutputStream.Write(iv);
            }
            if (secKeyData != null && secKeyData.Length > 0)
            {
                bcpgOutputStream.Write(secKeyData);
            }
            return(val.ToArray());
        }