private void DoAllTests()
        {
            var format = _th.Job.Profile.OutputFormat;

            PdfVersionTester.CheckPDFVersion(_th.Job, _pdfProcessor);

            SigningTester.TestSignature(_th.Job);

            if (_th.Profile.BackgroundPage.Enabled)
            {
                BackgroundPageTester.BackgroundOnPage(_th.Job);
            }

            /*
             * if (format == OutputFormat.PdfA1B || format == OutputFormat.PdfA2B)
             *  XmpMetadataTester.CheckForXMPMetadataUpdateStrings(_th.Job);
             */

            if (format != OutputFormat.PdfX)
            {
                PDFValidation.ValidatePdf(_th.Job);
            }

            //Must be last because it changes the encryption
            if ((format == OutputFormat.Pdf) && (_th.Profile.PdfSettings.Security.Enabled))
            {
                EncryptionTester.DoSecurityTest(_th.Job, IsIText);
                MakePasswordTests(_th.Job.Profile.OutputFormat);
            }
        }
Пример #2
0
        public void SigningPdfA2b_TwoSignatures_MultisigningIsEnabled_BothSignatuesAreValid()
        {
            TestHelper.Job.Profile.PdfSettings.Signature.AllowMultiSigning = true;

            TestHelper.Job.Profile.OutputFormat = OutputFormat.PdfA2B;
            TestHelper.Job.Profile.PdfSettings.Signature.DisplaySignatureInDocument = true;
            TestHelper.Job.Profile.PdfSettings.Signature.SignaturePage       = SignaturePage.FirstPage;
            TestHelper.Job.Profile.PdfSettings.Signature.SignatureCustomPage = 2;
            TestHelper.Job.Profile.PdfSettings.Signature.LeftX         = 300;
            TestHelper.Job.Profile.PdfSettings.Signature.LeftY         = 200;
            TestHelper.Job.Profile.PdfSettings.Signature.RightX        = 500;
            TestHelper.Job.Profile.PdfSettings.Signature.RightY        = 400;
            TestHelper.Job.Profile.PdfSettings.Signature.SignContact   = "Mr.Test";
            TestHelper.Job.Profile.PdfSettings.Signature.SignLocation  = "Testland";
            TestHelper.Job.Profile.PdfSettings.Signature.SignReason    = "The Reason is Testing";
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerUrl = "http://timestamp.globalsign.com/scripts/timestamp.dll";
            TestHelper.Job.Profile.PdfSettings.Security.Enabled        = false;

            PDFProcessor.ProcessPdf(TestHelper.Job);

            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
            SigningTester.TestSignature(TestHelper.Job);
            var multiSignedFile = SigningTester.TestMultipleSigning(TestHelper.Job, PDFProcessor);

            if (Debugger.IsAttached)
            {
                Process.Start(multiSignedFile);
                Debugger.Break();
            }
        }
Пример #3
0
 private void DoAllTheTesting(Job job)
 {
     PdfVersionTester.CheckPDFVersion(job, _pdfProcessor);
     EncryptionTester.DoSecurityTest(_th.Job, IsIText);
     SigningTester.TestSignature(job);
     MakePasswordTests();
 }
Пример #4
0
        private void TestEncryption()
        {
            _pdfProcessor.ProcessPdf(_th.Job);

            PdfVersionTester.CheckPDFVersion(_th.Job, _pdfProcessor);
            EncryptionTester.DoPasswordTest(_th.Job);
            EncryptionTester.DoSecurityTest(_th.Job, IsIText);
        }
Пример #5
0
        public void SigningPdfA2B()
        {
            TestHelper.GenerateGsJob_WithSetOutput(TestFile.PDFCreatorTestpage_GS9_19_PDF_A_2b);
            ApplySignatureSettings();

            PdfProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
        }
Пример #6
0
        private void DoTestTimeServer(string timeserverUrl)
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            _timeServerAccount.Url = timeserverUrl;

            PdfProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
        }
Пример #7
0
        public void SigningPdf_Invisible()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TestHelper.Job.Profile.PdfSettings.Signature.DisplaySignatureInDocument = false;

            PdfProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
        }
Пример #8
0
        public void SigningPdf_LastPage()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TestHelper.Job.Profile.PdfSettings.Signature.DisplaySignatureInDocument = true;
            TestHelper.Job.Profile.PdfSettings.Signature.SignaturePage       = SignaturePage.LastPage;
            TestHelper.Job.Profile.PdfSettings.Signature.SignatureCustomPage = 2;

            PdfProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
        }
Пример #9
0
        public void SigningPdf_CustomPageGreaterThanNumberOfPages()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TestHelper.Job.Profile.PdfSettings.Signature.DisplaySignatureInDocument = true;
            TestHelper.Job.Profile.PdfSettings.Signature.SignaturePage       = SignaturePage.CustomPage;
            TestHelper.Job.Profile.PdfSettings.Signature.SignatureCustomPage = 5;

            PDFProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
        }
Пример #10
0
        public void TimeServer_FreeTSA()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;

            TimeServerAccount.IsSecured = true;
            TimeServerAccount.UserName  = "******";
            TimeServerAccount.Password  = "******";

            PDFProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
        }
Пример #11
0
        public void EncryptionAndBackground()
        {
            GenerateGsJob_WithSettedOutput(TestFile.PDFCreatorTestpage_GS9_19_PDF); //Disables pdf metadata update
            _th.Job.Profile.PdfSettings.Security.Enabled  = true;
            _th.Job.Profile.PdfSettings.Signature.Enabled = false;
            _th.Job.Profile.BackgroundPage.Enabled        = true;

            _pdfProcessor.ProcessPdf(_th.Job);

            PdfVersionTester.CheckPDFVersion(_th.Job, _pdfProcessor);
            EncryptionTester.DoSecurityTest(_th.Job, IsIText);
            BackgroundPageTester.BackgroundOnPage(_th.Job);
        }
Пример #12
0
        public void SigningPdf_SecuredTimeServerEnabled_TimeserverDoesNotRequireLogin()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            _timeServerAccount.Url = "http://timestamp.globalsign.com/scripts/timestamp.dll";

            _timeServerAccount.IsSecured = true;
            _timeServerAccount.UserName  = "******";
            _timeServerAccount.Password  = "******";

            PdfProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
        }
Пример #13
0
        public void SigningPdfA2B_SecuredTimeServerEnabled_TimeserverDoesNotRequireLogin()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.PdfA2B;
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerUrl = "http://timestamp.globalsign.com/scripts/timestamp.dll";

            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerIsSecured = true;
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerLoginName = "TimeServerLoginName";
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerPassword  = "******";

            PDFProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
        }
Пример #14
0
        public void TimeServer_GlobalSign()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TimeServerAccount.Url = "http://timestamp.globalsign.com/scripts/timestamp.dll";

            TimeServerAccount.IsSecured = true;
            TimeServerAccount.UserName  = "******";
            TimeServerAccount.Password  = "******";

            PDFProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
        }
Пример #15
0
        public void SigningPdf_CustomPageSpecialCharacters()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TestHelper.Job.Profile.PdfSettings.Signature.SignaturePage       = SignaturePage.CustomPage;
            TestHelper.Job.Profile.PdfSettings.Signature.SignatureCustomPage = 2;
            TestHelper.Job.Profile.PdfSettings.Signature.SignContact         = "^^ Mr.Täst ^^";
            TestHelper.Job.Profile.PdfSettings.Signature.SignLocation        = "Tästlènd";
            TestHelper.Job.Profile.PdfSettings.Signature.SignReason          = "The Réßön is Tästing";

            PdfProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
        }
Пример #16
0
        public void SigningPdf_CustomPageSpecialCharacters()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TestHelper.Job.Profile.PdfSettings.Signature.SignaturePage       = SignaturePage.CustomPage;
            TestHelper.Job.Profile.PdfSettings.Signature.SignatureCustomPage = 2;
            TestHelper.Job.Profile.PdfSettings.Signature.SignContact         = "^^ Mr.Täst ^^";
            TestHelper.Job.Profile.PdfSettings.Signature.SignLocation        = "Tästlènd";
            TestHelper.Job.Profile.PdfSettings.Signature.SignReason          = "The Réßön is Tästing";
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerUrl       = "http://timestamp.globalsign.com/scripts/timestamp.dll";

            PDFProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
        }
Пример #17
0
        public void SigningPdfA1b_TwoSignatures_MultisigningIsEnabled_BothSignatuesAreValid()
        {
            TestHelper.Job.Profile.PdfSettings.Signature.AllowMultiSigning = true;

            TestHelper.Job.Profile.OutputFormat = OutputFormat.PdfA1B;
            TestHelper.Job.Profile.PdfSettings.Signature.DisplaySignatureInDocument = true;

            PDFProcessor.ProcessPdf(TestHelper.Job);

            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
            SigningTester.TestSignature(TestHelper.Job);
            var multiSignedFile = SigningTester.TestMultipleSigning(TestHelper.Job, PDFProcessor);

            if (Debugger.IsAttached)
            {
                Process.Start(multiSignedFile);
                Debugger.Break();
            }
        }
Пример #18
0
        public void SigningPdf_TwoSignatures_MultisigningIsEnabled_FirstSignatureIsValid()
        {
            if (!Debugger.IsAttached)
            {
                return;
            }

            // TODO make multi-signing testable

            TestHelper.Job.Profile.PdfSettings.Signature.AllowMultiSigning = true;

            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TestHelper.Job.Profile.PdfSettings.Signature.DisplaySignatureInDocument = true;

            PdfProcessor.ProcessPdf(TestHelper.Job);

            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
            SigningTester.TestSignature(TestHelper.Job);
            var multiSignedFile = SigningTester.TestMultipleSigning(TestHelper.Job, PdfProcessor);

            Process.Start(multiSignedFile);
            Debugger.Break();
        }
Пример #19
0
        public void SigningPdfA1b_TwoSignatures_MultisigningIsDisabled_BothSignatureAreValid()
        {
            TestHelper.Job.Profile.PdfSettings.Signature.AllowMultiSigning = false;

            TestHelper.Job.Profile.OutputFormat = OutputFormat.PdfA1B;
            TestHelper.Job.Profile.PdfSettings.Signature.DisplaySignatureInDocument = true;

            PDFProcessor.ProcessPdf(TestHelper.Job);

            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
            SigningTester.TestSignature(TestHelper.Job);

            //Enable AllowMultiSigning for Test
            //PDF/A-1b does not support blocking signatures
            //and should automatically enable AllowMultiSigning
            TestHelper.Job.Profile.PdfSettings.Signature.AllowMultiSigning = true;
            var multiSignedFile = SigningTester.TestMultipleSigning(TestHelper.Job, PDFProcessor);

            if (Debugger.IsAttached)
            {
                Process.Start(multiSignedFile);
                Debugger.Break();
            }
        }