예제 #1
0
        public override void SaveAs(Stream strm, string header, IEncryption encrypt)
        {
            int num1;

            this.UpdateInfo();
            bool flag1 = false;
            Snow snow1 = new Snow();

            snow1.LoadKey(41869, Rect.serial[0], 1, 0);
            uint[] numArray1 = new uint[3];
            for (num1 = 0; (num1 < 3); num1 += 1)
            {
                numArray1[num1] = Rect.serial[(num1 + 1)];
            }
            snow1.EncryptDecrypt(ref numArray1);
            flag1 = ((bool)(((((numArray1[0] ^ numArray1[1]) ^ numArray1[2]) & (Circle.productType & 44933)) != (Circle.productType & 44933)) ? 0 : (numArray1[0] == numArray1[1])));
            if (!flag1 && (encrypt != null))
            {
                throw new SecurityException("Ecnryption is unsupported in the trial version");
            }
            PDFDict   dict1 = this.mTrailer;
            ArrayList list1 = ((ArrayList)this.mXRef.Clone());

            this.mTrailer         = ((PDFDict)dict1.Clone());
            this.mTrailer["Info"] = dict1["Info"];
            string text1 = Encoding.ASCII.GetString(this.GenerateFileId(this.mPath));

            string[] textArray1 = new string[2];
            textArray1[0]       = text1;
            textArray1[1]       = text1;
            this.mTrailer["ID"] = PDF.O(textArray1);
            PDFDict dict2 = encrypt.CreateEncryptionDict(this);

            this.mTrailer["Encrypt"] = this.Indirects.New(dict2);
            this.mWriter.Encryption  = encrypt;
            this.SaveAs(strm, header);
            this.mWriter.Encryption = null;
            this.mXRef    = list1;
            this.mTrailer = dict1;
        }