override public void Execute()
        {
            DocumentPackage package = PackageBuilder.NewPackageNamed("C# AuthenticationMethodsExample " + DateTime.Now)
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                  .WithFirstName("John1")
                                                  .WithLastName("Smith1"))
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email2)
                                                  .WithCustomId("signer2")
                                                  .WithFirstName("John2")
                                                  .WithLastName("Smith2")
                                                  .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion(QUESTION1)
                                                                           .Answer(ANSWER1, Challenge.MaskOptions.None)
                                                                           .SecondQuestion(QUESTION2)
                                                                           .Answer(ANSWER2, Challenge.MaskOptions.MaskInput)))
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email3)
                                                  .WithFirstName("John3")
                                                  .WithLastName("Smith3")
                                                  .WithSMSSentTo(sms3))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("Custom Consent Document")
                                                    .FromStream(fileStream1, DocumentType.PDF)
                                                    .WithSignature(SignatureBuilder.SignatureFor(email2)
                                                                   .OnPage(0)
                                                                   .AtPosition(100, 100)))
                                      .Build();

            packageId = eslClient.CreatePackage(package);
            eslClient.SendPackage(packageId);
        }
        override public void Execute()
        {
            DocumentPackage package = PackageBuilder.NewPackageNamed(PackageName)
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                  .WithFirstName("John1")
                                                  .WithLastName("Smith1"))
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email2)
                                                  .WithCustomId("signer2")
                                                  .WithFirstName("John2")
                                                  .WithLastName("Smith2")
                                                  .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion(QUESTION1)
                                                                           .Answer(ANSWER1)
                                                                           .SecondQuestion(QUESTION2)
                                                                           .Answer(ANSWER2, Challenge.MaskOptions.MaskInput)))
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email3)
                                                  .WithFirstName("John3")
                                                  .WithLastName("Smith3"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("Custom Consent Document")
                                                    .FromStream(fileStream1, DocumentType.PDF)
                                                    .WithSignature(SignatureBuilder.SignatureFor(email2)
                                                                   .OnPage(0)
                                                                   .AtPosition(100, 100)))
                                      .Build();

            packageId        = ossClient.CreatePackage(package);
            retrievedPackage = ossClient.GetPackage(packageId);
        }
Beispiel #3
0
        override public void Execute()
        {
            DocumentPackage package = PackageBuilder.NewPackageNamed("C# AuthenticationMethodsExample " + DateTime.Now)
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                  .WithFirstName("John1")
                                                  .WithLastName("Smith1"))
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email2)
                                                  .WithFirstName("John2")
                                                  .WithLastName("Smith2")
                                                  .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's 1+1?")
                                                                           .Answer("2")
                                                                           .SecondQuestion("What color's the sky?")
                                                                           .Answer("blue")))
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email3)
                                                  .WithFirstName("John3")
                                                  .WithLastName("Smith3")
                                                  .WithSMSSentTo(sms3))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("Custom Consent Document")
                                                    .FromStream(fileStream1, DocumentType.PDF)
                                                    .WithSignature(SignatureBuilder.AcceptanceFor(email1)
                                                                   .OnPage(0)
                                                                   .AtPosition(100, 100)))
                                      .Build();

            PackageId id = eslClient.CreatePackage(package);

            eslClient.SendPackage(id);

            DocumentPackage retrievedPackage = eslClient.GetPackage(id);
        }
 public void CannotProvideQuestionWithoutAnswer()
 {
     Assert.Throws <OssException>(() => SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                  .WithFirstName("Billy")
                                  .WithLastName("Bob")
                                  .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's your favorite sport?"))
                                  .Build());
 }
        override public void Execute()
        {
            Signer signer1 = SignerBuilder.NewSignerWithEmail(email1)
                             .WithFirstName(SIGNER1_FIRST_NAME)
                             .WithLastName(SIGNER1_LAST_NAME)
                             .WithCustomId(SIGNER1_CUSTOM_ID)
                             .Build();

            Signer signer2 = SignerBuilder.NewSignerWithEmail(email2)
                             .WithFirstName(SIGNER2_FIRST_NAME)
                             .WithLastName(SIGNER2_LAST_NAME)
                             .WithLanguage(SIGNER2_LANGUAGE)
                             .WithCustomId(SIGNER2_CUSTOM_ID)
                             .Build();

            Signer signer3 = SignerBuilder.NewSignerWithEmail(email3)
                             .WithFirstName(SIGNER3_FIRST_NAME)
                             .WithLastName(SIGNER3_LAST_NAME)
                             .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion(SIGNER3_FIRST_QUESTION)
                                                      .Answer(SIGNER3_FIRST_ANSWER)
                                                      .SecondQuestion(SIGNER3_SECOND_QUESTION)
                                                      .Answer(SIGNER3_SECOND_ANSWER))
                             .WithCustomId(SIGNER1_CUSTOM_ID)
                             .Build();

            Signer signer4 = SignerBuilder.NewSignerWithEmail(email2)
                             .WithFirstName(SIGNER2_FIRST_NAME)
                             .WithLastName(SIGNER2_LAST_NAME)
                             .WithSMSSentTo(sms1)
                             .WithLanguage(SIGNER2_UPDATE_LANGUAGE)
                             .WithCustomId(SIGNER2_CUSTOM_ID).Build();

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed(PackageName)
                                                .DescribedAs("This is a package created using the eSignLive SDK")
                                                .WithSigner(signer1)
                                                .WithSigner(signer2)
                                                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                                                              .FromStream(fileStream1, DocumentType.PDF)
                                                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                             .OnPage(0)
                                                                             .AtPosition(30, 100))
                                                              .WithSignature(SignatureBuilder.SignatureFor(email2)
                                                                             .OnPage(0)
                                                                             .AtPosition(30, 400)))
                                                .Build();

            packageId = ossClient.CreatePackage(superDuperPackage);
            ossClient.SendPackage(packageId);
            retrievedPackage = ossClient.GetPackage(packageId);

            ossClient.ChangePackageStatusToDraft(packageId);
            ossClient.PackageService.UpdateSigner(packageId, signer3);
            ossClient.PackageService.UpdateSigner(packageId, signer4);

            ossClient.SendPackage(packageId);
            updatedPackage = ossClient.GetPackage(packageId);
        }
        public void ProvidingQuestionsAndAnswersSetsAuthenticationMethodToChallenge()
        {
            Signer signer = SignerBuilder.NewSignerWithEmail("*****@*****.**")
                            .WithFirstName("Billy")
                            .WithLastName("Bob")
                            .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's your favorite sport?")
                                                     .Answer("golf"))
                            .Build();

            Assert.AreEqual(AuthenticationMethod.CHALLENGE, signer.AuthenticationMethod);
        }
        public void SavesProvidesQuestionsAndAnswers()
        {
            Signer signer = SignerBuilder.NewSignerWithEmail("*****@*****.**")
                            .WithFirstName("Billy")
                            .WithLastName("Bob")
                            .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's your favorite sport?")
                                                     .Answer("golf")
                                                     .SecondQuestion("Do you have a pet?")
                                                     .Answer("yes"))
                            .Build();

            Assert.AreEqual(signer.ChallengeQuestion[0], new Challenge("What's your favorite sport?", "golf", Challenge.MaskOptions.None));
            Assert.AreEqual(signer.ChallengeQuestion[1], new Challenge("Do you have a pet?", "yes", Challenge.MaskOptions.None));
        }
Beispiel #8
0
        override public void Execute()
        {
            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("SignerQnAChallengeExample: " + DateTime.Now)
                                                .DescribedAs("This is a Q&A authentication example")
                                                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                            .WithFirstName("John")
                                                            .WithLastName("Smith")
                                                            .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion(FIRST_QUESTION)
                                                                                     .Answer(FIRST_ANSWER)
                                                                                     .SecondQuestion(SECOND_QUESTION)
                                                                                     .Answer(SECOND_ANSWER)))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                                                              .FromStream(fileStream1, DocumentType.PDF)
                                                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                             .OnPage(0)
                                                                             .AtPosition(199, 100)))
                                                .Build();

            packageId = eslClient.CreatePackage(superDuperPackage);

            eslClient.SendPackage(packageId);
        }
Beispiel #9
0
        override public void Execute()
        {
            SIGNER_WITH_AUTHENTICATION_EQUIFAX_CANADA =
                SignerBuilder.NewSignerWithEmail(email1)
                .WithFirstName("Signer1")
                .WithLastName("Canada")
                .WithCustomId("SingerCanadaID")
                .ChallengedWithKnowledgeBasedAuthentication(
                    SignerInformationForEquifaxCanadaBuilder.NewSignerInformationForEquifaxCanada()
                    .WithFirstName("Signer1")
                    .WithLastName("lastNameCanada")
                    .WithStreetAddress("1111")
                    .WithCity("Montreal")
                    .WithProvince("QC")
                    .WithPostalCode("A1A1A1")
                    .WithTimeAtAddress(1)
                    .WithDriversLicenseNumber("Driver licence number")
                    .WithSocialInsuranceNumber("111222333")
                    .WithHomePhoneNumber("5141112222")
                    .WithDateOfBirth(new DateTime(1965, 1, 1)))
                .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's your favorite restaurant? (answer: Staffany)")
                                         .Answer("Staffany")
                                         .SecondQuestion("What sport do you play? (answer: hockey)")
                                         .Answer("hockey"))
                .Build();

            SIGNER_WITH_AUTHENTICATION_EQUIFAX_USA =
                SignerBuilder.NewSignerWithEmail(email2)
                .WithFirstName("Signer2")
                .WithLastName("USA")
                .WithCustomId("SignerUSAID")
                .ChallengedWithKnowledgeBasedAuthentication(
                    SignerInformationForEquifaxUSABuilder.NewSignerInformationForEquifaxUSA()
                    .WithFirstName("Singer2")
                    .WithLastName("lastNameUSA")
                    .WithStreetAddress("2222")
                    .WithCity("New York")
                    .WithState("NY")
                    .WithZip("65212")
                    .WithSocialSecurityNumber("222667098")
                    .WithHomePhoneNumber("8701116547")
                    .WithTimeAtAddress(3)
                    .WithDriversLicenseNumber("Driver License Number")
                    .WithDateOfBirth(new DateTime(1967, 2, 2)))
                .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's your favorite sport? (answer: golf)")
                                         .Answer("golf")
                                         .SecondQuestion("What music instrument do you play? (answer: drums)")
                                         .Answer("drums"))
                .Build();

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed(PackageName)
                                                .DescribedAs("This is a package created using the eSignLive SDK")
                                                .WithSigner(SIGNER_WITH_AUTHENTICATION_EQUIFAX_CANADA)
                                                .WithSigner(SIGNER_WITH_AUTHENTICATION_EQUIFAX_USA)
                                                .WithDocument(DocumentBuilder.NewDocumentNamed(documentName)
                                                              .FromStream(fileStream1, DocumentType.PDF)
                                                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                             .Build())
                                                              .WithSignature(SignatureBuilder.SignatureFor(email2)
                                                                             .Build())
                                                              .Build())
                                                .Build();

            packageId = ossClient.CreateAndSendPackage(superDuperPackage);

            retrievedPackage = ossClient.GetPackage(packageId);
        }