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

public ReadAll ( ) : byte[]
Результат byte[]
Пример #1
0
 public SymmetricKeyEncSessionPacket(BcpgInputStream bcpgIn)
 {
     version      = ((Stream)bcpgIn).ReadByte();
     encAlgorithm = (SymmetricKeyAlgorithmTag)((Stream)bcpgIn).ReadByte();
     s2k          = new S2k((Stream)(object)bcpgIn);
     secKeyData   = bcpgIn.ReadAll();
 }
        internal SecretKeyPacket(
            BcpgInputStream bcpgIn)
        {
            pubKeyPacket = new PublicKeyPacket(bcpgIn);

            s2kUsage = bcpgIn.ReadByte();

            if (s2kUsage == UsageChecksum || s2kUsage == UsageSha1)
            {
                encAlgorithm = (SymmetricKeyAlgorithmTag)bcpgIn.ReadByte();
                s2k          = new S2k(bcpgIn);
            }
            else
            {
                encAlgorithm = (SymmetricKeyAlgorithmTag)s2kUsage;
            }

            if (!(s2k != null && s2k.Type == S2k.GnuDummyS2K && s2k.ProtectionMode == 0x01))
            {
                if (s2kUsage != 0)
                {
                    if (((int)encAlgorithm) < 7)
                    {
                        iv = new byte[8];
                    }
                    else
                    {
                        iv = new byte[16];
                    }
                    bcpgIn.ReadFully(iv);
                }
            }

            secKeyData = bcpgIn.ReadAll();
        }
 public SymmetricKeyEncSessionPacket(BcpgInputStream bcpgIn)
 {
     this.version      = bcpgIn.ReadByte();
     this.encAlgorithm = (SymmetricKeyAlgorithmTag)bcpgIn.ReadByte();
     this.s2k          = new S2k(bcpgIn);
     this.secKeyData   = bcpgIn.ReadAll();
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SecretKeyPacket"/> class.
        /// </summary>
        /// <param name="bcpgIn">The BCPG in.</param>
        internal SecretKeyPacket(BcpgInputStream bcpgIn)
        {
            if (this is SecretSubkeyPacket)
            {
                this.PublicKeyPacket = new PublicSubkeyPacket(bcpgIn);
            }
            else
            {
                this.PublicKeyPacket = new PublicKeyPacket(bcpgIn);
            }

            this.S2KUsage = bcpgIn.ReadByte();

            if (this.S2KUsage == UsageChecksum || this.S2KUsage == UsageSha1)
            {
                this.EncAlgorithm = (SymmetricKeyAlgorithmTag)bcpgIn.ReadByte();
                this.S2K          = new S2k(bcpgIn);
            }
            else
            {
                this.EncAlgorithm = (SymmetricKeyAlgorithmTag)this.S2KUsage;
            }

            if (!(this.S2K != null && this.S2K.Type == S2k.GnuDummyS2K && this.S2K.ProtectionMode == 0x01))
            {
                if (this.S2KUsage != 0)
                {
                    _iv = ((int)EncAlgorithm) < 7 ? new byte[8] : new byte[16];
                    bcpgIn.ReadFully(_iv);
                }
            }

            _secKeyData = bcpgIn.ReadAll();
        }
Пример #5
0
 internal SecretKeyPacket(BcpgInputStream bcpgIn)
 {
     if (this is SecretSubkeyPacket)
     {
         this.pubKeyPacket = new PublicSubkeyPacket(bcpgIn);
     }
     else
     {
         this.pubKeyPacket = new PublicKeyPacket(bcpgIn);
     }
     this.s2kUsage = bcpgIn.ReadByte();
     if (this.s2kUsage == 255 || this.s2kUsage == 254)
     {
         this.encAlgorithm = (SymmetricKeyAlgorithmTag)bcpgIn.ReadByte();
         this.s2k          = new S2k(bcpgIn);
     }
     else
     {
         this.encAlgorithm = (SymmetricKeyAlgorithmTag)this.s2kUsage;
     }
     if ((this.s2k == null || this.s2k.Type != 101 || this.s2k.ProtectionMode != 1) && this.s2kUsage != 0)
     {
         if (this.encAlgorithm < SymmetricKeyAlgorithmTag.Aes128)
         {
             this.iv = new byte[8];
         }
         else
         {
             this.iv = new byte[16];
         }
         bcpgIn.ReadFully(this.iv);
     }
     this.secKeyData = bcpgIn.ReadAll();
 }
Пример #6
0
 internal SecretKeyPacket(BcpgInputStream bcpgIn)
 {
     if (this is SecretSubkeyPacket)
     {
         pubKeyPacket = new PublicSubkeyPacket(bcpgIn);
     }
     else
     {
         pubKeyPacket = new PublicKeyPacket(bcpgIn);
     }
     s2kUsage = ((Stream)bcpgIn).ReadByte();
     if (s2kUsage == 255 || s2kUsage == 254)
     {
         encAlgorithm = (SymmetricKeyAlgorithmTag)((Stream)bcpgIn).ReadByte();
         s2k          = new S2k((Stream)(object)bcpgIn);
     }
     else
     {
         encAlgorithm = (SymmetricKeyAlgorithmTag)s2kUsage;
     }
     if ((s2k == null || s2k.Type != 101 || s2k.ProtectionMode != 1) && s2kUsage != 0)
     {
         if (encAlgorithm < SymmetricKeyAlgorithmTag.Aes128)
         {
             iv = new byte[8];
         }
         else
         {
             iv = new byte[16];
         }
         bcpgIn.ReadFully(iv);
     }
     secKeyData = bcpgIn.ReadAll();
 }
		internal ExperimentalPacket(
            PacketTag		tag,
            BcpgInputStream	bcpgIn)
        {
            this.tag = tag;

			this.contents = bcpgIn.ReadAll();
        }
Пример #8
0
        internal ExperimentalPacket(
            PacketTag tag,
            BcpgInputStream bcpgIn)
        {
            this.tag = tag;

            this.contents = bcpgIn.ReadAll();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SymmetricKeyEncSessionPacket"/> class.
        /// </summary>
        /// <param name="bcpgIn">The BCPG in.</param>
        public SymmetricKeyEncSessionPacket(BcpgInputStream bcpgIn)
        {
            Version      = bcpgIn.ReadByte();
            EncAlgorithm = (SymmetricKeyAlgorithmTag)bcpgIn.ReadByte();

            S2K = new S2k(bcpgIn);

            _secKeyData = bcpgIn.ReadAll();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SymmetricKeyEncSessionPacket"/> class.
        /// </summary>
        /// <param name="bcpgIn">The BCPG in.</param>
        public SymmetricKeyEncSessionPacket(BcpgInputStream bcpgIn)
        {
            Version = bcpgIn.ReadByte();
            EncAlgorithm = (SymmetricKeyAlgorithmTag)bcpgIn.ReadByte();

            S2K = new S2k(bcpgIn);

            _secKeyData = bcpgIn.ReadAll();
        }
Пример #11
0
		internal SecretKeyPacket(
            BcpgInputStream bcpgIn)
        {
			if (this is SecretSubkeyPacket)
			{
				pubKeyPacket = new PublicSubkeyPacket(bcpgIn);
			}
			else
			{
				pubKeyPacket = new PublicKeyPacket(bcpgIn);
			}

			s2kUsage = bcpgIn.ReadByte();

			if (s2kUsage == UsageChecksum || s2kUsage == UsageSha1)
            {
                encAlgorithm = (SymmetricKeyAlgorithmTag) bcpgIn.ReadByte();
                s2k = new S2k(bcpgIn);
            }
            else
            {
                encAlgorithm = (SymmetricKeyAlgorithmTag) s2kUsage;
			}

			if (!(s2k != null && s2k.Type == S2k.GnuDummyS2K && s2k.ProtectionMode == 0x01))
            {
				if (s2kUsage != 0)
				{
                    if (((int) encAlgorithm) < 7)
                    {
                        iv = new byte[8];
                    }
                    else
                    {
                        iv = new byte[16];
                    }
                    bcpgIn.ReadFully(iv);
                }
            }

			secKeyData = bcpgIn.ReadAll();
        }
Пример #12
0
 public UserIdPacket(BcpgInputStream bcpgIn)
 {
     _idData = bcpgIn.ReadAll();
 }
Пример #13
0
 public UserIdPacket(
     BcpgInputStream bcpgIn)
 {
     this.idData = bcpgIn.ReadAll();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="SecretKeyPacket"/> class.
        /// </summary>
        /// <param name="bcpgIn">The BCPG in.</param>
        internal SecretKeyPacket(BcpgInputStream bcpgIn)
        {
            if (this is SecretSubkeyPacket)
            {
                this.PublicKeyPacket = new PublicSubkeyPacket(bcpgIn);
            }
            else
            {
                this.PublicKeyPacket = new PublicKeyPacket(bcpgIn);
            }

            this.S2KUsage = bcpgIn.ReadByte();

            if (this.S2KUsage == UsageChecksum || this.S2KUsage == UsageSha1)
            {
                this.EncAlgorithm = (SymmetricKeyAlgorithmTag)bcpgIn.ReadByte();
                this.S2K = new S2k(bcpgIn);
            }
            else
            {
                this.EncAlgorithm = (SymmetricKeyAlgorithmTag)this.S2KUsage;
            }

            if (!(this.S2K != null && this.S2K.Type == S2k.GnuDummyS2K && this.S2K.ProtectionMode == 0x01))
            {
                if (this.S2KUsage != 0)
                {
                    _iv = ((int)EncAlgorithm) < 7 ? new byte[8] : new byte[16];
                    bcpgIn.ReadFully(_iv);
                }
            }

            _secKeyData = bcpgIn.ReadAll();
        }