internal PublicKeyEncSessionPacket(
            BcpgInputStream bcpgIn)
        {
            version = bcpgIn.ReadByte();

            keyId |= (long)bcpgIn.ReadByte() << 56;
            keyId |= (long)bcpgIn.ReadByte() << 48;
            keyId |= (long)bcpgIn.ReadByte() << 40;
            keyId |= (long)bcpgIn.ReadByte() << 32;
            keyId |= (long)bcpgIn.ReadByte() << 24;
            keyId |= (long)bcpgIn.ReadByte() << 16;
            keyId |= (long)bcpgIn.ReadByte() << 8;
            keyId |= (uint)bcpgIn.ReadByte();

            algorithm = (PublicKeyAlgorithmTag)bcpgIn.ReadByte();

            switch ((PublicKeyAlgorithmTag)algorithm)
            {
            case PublicKeyAlgorithmTag.RsaEncrypt:
            case PublicKeyAlgorithmTag.RsaGeneral:
                data = new byte[][] { new MPInteger(bcpgIn).GetEncoded() };
                break;

            case PublicKeyAlgorithmTag.ElGamalEncrypt:
            case PublicKeyAlgorithmTag.ElGamalGeneral:
                MPInteger p = new MPInteger(bcpgIn);
                MPInteger g = new MPInteger(bcpgIn);
                data = new byte[][] {
                    p.GetEncoded(),
                        g.GetEncoded(),
                };
                break;

            case PublicKeyAlgorithmTag.ECDH:
                data = new byte[][] { Streams.ReadAll(bcpgIn) };
                break;

            default:
                throw new IOException("unknown PGP public key algorithm encountered");
            }
        }
        internal PublicKeyEncSessionPacket(BcpgInputStream bcpgIn)
        {
            //IL_0171: Unknown result type (might be due to invalid IL or missing references)
            version   = ((Stream)bcpgIn).ReadByte();
            keyId    |= (long)((Stream)bcpgIn).ReadByte() << 56;
            keyId    |= (long)((Stream)bcpgIn).ReadByte() << 48;
            keyId    |= (long)((Stream)bcpgIn).ReadByte() << 40;
            keyId    |= (long)((Stream)bcpgIn).ReadByte() << 32;
            keyId    |= (long)((Stream)bcpgIn).ReadByte() << 24;
            keyId    |= (long)((Stream)bcpgIn).ReadByte() << 16;
            keyId    |= (long)((Stream)bcpgIn).ReadByte() << 8;
            keyId    |= (uint)((Stream)bcpgIn).ReadByte();
            algorithm = (PublicKeyAlgorithmTag)((Stream)bcpgIn).ReadByte();
            switch (algorithm)
            {
            case PublicKeyAlgorithmTag.RsaGeneral:
            case PublicKeyAlgorithmTag.RsaEncrypt:
                data = new byte[1][] { new MPInteger(bcpgIn).GetEncoded() };
                break;

            case PublicKeyAlgorithmTag.ElGamalEncrypt:
            case PublicKeyAlgorithmTag.ElGamalGeneral:
            {
                MPInteger mPInteger  = new MPInteger(bcpgIn);
                MPInteger mPInteger2 = new MPInteger(bcpgIn);
                data = new byte[2][]
                {
                    mPInteger.GetEncoded(),
                        mPInteger2.GetEncoded()
                };
                break;
            }

            case PublicKeyAlgorithmTag.EC:
                data = new byte[1][] { Streams.ReadAll((Stream)(object)bcpgIn) };
                break;

            default:
                throw new IOException("unknown PGP public key algorithm encountered");
            }
        }
		internal PublicKeyEncSessionPacket(
			BcpgInputStream bcpgIn)
		{
			version = bcpgIn.ReadByte();

			keyId |= (long)bcpgIn.ReadByte() << 56;
			keyId |= (long)bcpgIn.ReadByte() << 48;
			keyId |= (long)bcpgIn.ReadByte() << 40;
			keyId |= (long)bcpgIn.ReadByte() << 32;
			keyId |= (long)bcpgIn.ReadByte() << 24;
			keyId |= (long)bcpgIn.ReadByte() << 16;
			keyId |= (long)bcpgIn.ReadByte() << 8;
			keyId |= (uint)bcpgIn.ReadByte();

			algorithm = (PublicKeyAlgorithmTag) bcpgIn.ReadByte();

			switch ((PublicKeyAlgorithmTag) algorithm)
			{
				case PublicKeyAlgorithmTag.RsaEncrypt:
				case PublicKeyAlgorithmTag.RsaGeneral:
					data = new byte[][]{ new MPInteger(bcpgIn).GetEncoded() };
					break;
				case PublicKeyAlgorithmTag.ElGamalEncrypt:
				case PublicKeyAlgorithmTag.ElGamalGeneral:
                    MPInteger p = new MPInteger(bcpgIn);
                    MPInteger g = new MPInteger(bcpgIn);
					data = new byte[][]{
                        p.GetEncoded(),
                        g.GetEncoded(),
                    };
					break;
                case PublicKeyAlgorithmTag.ECDH:
                    data = new byte[][]{ Streams.ReadAll(bcpgIn) };
                    break;
				default:
					throw new IOException("unknown PGP public key algorithm encountered");
			}
		}