コード例 #1
0
        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);
        }
コード例 #2
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)
                                                  .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);
        }
コード例 #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);
        }
コード例 #4
0
 public void CannotProvideQuestionWithoutAnswer()
 {
     Assert.Throws <OssException>(() => SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                  .WithFirstName("Billy")
                                  .WithLastName("Bob")
                                  .ChallengedWithQuestions(ChallengeBuilder.FirstQuestion("What's your favorite sport?"))
                                  .Build());
 }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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));
        }
コード例 #8
0
        public void GetChallengeAdapter_Success()
        {
            // Arrange
            var requestBuilder = new ChallengeBuilder().FavoratePassTime();
            var mokAdapter     = new ChallengeAdapter();

            // Act
            var response = mokAdapter.Get(Guid.NewGuid());
            var expected = requestBuilder.UpdateId(response.Id).Build();

            // Assert
            Assert.IsNotNull(response);
            var compareDetails = Comparer.Compare(expected, response);

            compareDetails.DisplayDifferences();
            Assert.IsTrue(compareDetails.AreEqual, "The initative comparison failed");
        }
コード例 #9
0
        public void EditChallengeProvider_Success()
        {
            // Arrange
            var requestBuilder = new ChallengeBuilder().FavoratePassTime().UpdateQuestion("Custom question");
            var mokAdapter     = new AdapterBuilder().AddUpdateStub(requestBuilder.Build()).Build();
            var provider       = new ChallengeProvider(mokAdapter);

            // Act
            var response = provider.Update(requestBuilder.Id, requestBuilder.BuildRequest());
            var expected = requestBuilder.UpdateId(response.Id).Build();

            // Assert
            Assert.IsNotNull(response);
            var compareDetails = Comparer.Compare(expected, response);

            compareDetails.DisplayDifferences();
            Assert.IsTrue(compareDetails.AreEqual, "The initative comparison failed");
        }
コード例 #10
0
        public override void Start()
        {
            //-------------SETUP----------
            //You need to init ChallengeBuilder for ChallengeAPI to work.
            ChallengeBuilder.Init();
            //If Debug Mode is enabled, the challenge mode will only have the most recent challenge that was added.
            ChallengeBuilder.EnableDebugMode();
            //-------------BUILDING CHALLENGES----------
            //Builds a basic challenge.
            ChallengeBuilder.BuildChallenge <ExampleChallengeModifier>("ChallengeAPI/Resources/exampleChallengeFrame.png", "SpecialAPI Tests Stuff", true, null, null, null, true, true);
            //Builds a challenge and sets it's variable. Chamber's Curse challenge was made by Some Bunny by the way!
            ChallengeDataEntry chamberCurseChallenge = ChallengeBuilder.BuildChallenge <ChambersCurseModifier>("ChallengeAPI/Resources/curseOfTheChamberFrame.png", "Chamber's Curse", true, new List <ChallengeModifier> {
                ChallengeBuilder.ChallengeManagerPrefab.FindChallenge <SkyRocketChallengeModifier>().challenge
            }, null, null, true, true);                                                                                                   //If you want the challenge to only

            // appear in normal challenge mode or only appear in double challenge mode you can change one of the trues at the end of the function to false. The first true handles if the challenge appears in normal challenge mode and the second one handles if
            // it appears in double challenge mode
            // You can also make the challenge not be compatible with other challenges using the Mutually exclusive argument (the List<ChallengeModifier> thing). For example Chamber's Curse challenge isn't compatible with Gull's Revenge challenge.
            (chamberCurseChallenge.challenge as ChambersCurseModifier).dragunBoulder = Gungeon.Game.Enemies["dragun_advanced"].GetComponent <DraGunController>().skyBoulder;
            //------------BUILDING A BOSS CHALLENGE----------
            //Builds a special boss challenges and DOESN'T ADD IT TO CHALLENGE POOL.
            ChallengeDataEntry exampleBossChallenge = ChallengeBuilder.BuildChallenge <ExampleBossChallenge>("ChallengeAPI/Resources/exampleBossChallengeFrame.png", "Example Boss Challenge", true, null, null, null, false, false); // The false, false

            //                                                                                                                                                                         at the end prevent the challenge from being added to the challenge pool.
            //Sets the boss challenge's healthMultiplier field making it multiply the health of all bosses by 1.5;
            (exampleBossChallenge.challenge as ExampleBossChallenge).healthMultiplier = 1.5f;
            //Builds the boss challenge. If a boss has a boss challenge attached to it, the game will ONLY choose the challenges from the boss challenge, ignoring any other challenges.
            //For example this boss challenge will make the game always choose the Example Boss Challenge and the Chamber's Curse challenge when the player is fighting the Bullet King or the Beholster in challenge mode.
            ChallengeBuilder.BuildBossChallenge("Example Boss Challenge", new List <AIActor> {
                Gungeon.Game.Enemies["bullet_king"], Gungeon.Game.Enemies["beholster"]
            }, 2, new List <ChallengeDataEntry> {
                chamberCurseChallenge, exampleBossChallenge
            }, true,
                                                true);
            //Or for example this boss challenge will make the game always choose the Example Boss Challenge OR the Chamber's Curse challenge when the player is fighting the Gorgun. The reason it only chooses one of the challenges is because this boss
            // has it's numChallengesToUse argument set to one.                                     (numChallengesToUse argument is the 1 below )
            ChallengeBuilder.BuildBossChallenge("Example Boss Challenge 2", new List <AIActor> {
                Gungeon.Game.Enemies["gorgun"]
            }, 1, new List <ChallengeDataEntry> {
                chamberCurseChallenge, exampleBossChallenge
            }, true, true);
        }
コード例 #11
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);
        }
コード例 #12
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);
        }