Exemplo n.º 1
0
        public async Task <IEnumerable <PersonalCard> > Finish(IdentityTokenRequest request, string confirmationCode)
        {
            var services = ServiceLocator.Services;

            var confirmedInfo = await request.Confirm(confirmationCode, new ConfirmOptions(3600, this.setup.Count()))
                                .ConfigureAwait(false);

            var list = this.setup.Select(async card =>
            {
                var grabResponse = await services.PrivateKeys.Get(card.Id, confirmedInfo)
                                   .ConfigureAwait(false);

                var privateKey = new PrivateKey(grabResponse.PrivateKey);


                var cards = await services.Cards.GetCardsRealtedToThePublicKey(card.PublicKeyId, card.Id, privateKey)
                            .ConfigureAwait(false);

                return(cards.Select(it => new PersonalCard(it, privateKey)).ToList());
            }).ToList();

            await Task.WhenAll(list)
            .ConfigureAwait(false);

            var personalCards = list.SelectMany(i => i.Result).ToList();

            return(personalCards);
        }
Exemplo n.º 2
0
 public static async Task <IdentityTokenRequest> Verify(string value, VerifiableIdentityType type = VerifiableIdentityType.Email)
 {
     return(await IdentityTokenRequest.Verify(value, type).ConfigureAwait(false));
 }
Exemplo n.º 3
0
 public async Task <IdentityTokenRequest> Verify()
 {
     return(await IdentityTokenRequest.Verify(this.Value, this.Type).ConfigureAwait(false));
 }