Ejemplo n.º 1
0
        public async Task GetRevokedCard_ExistingCard_ShouldThrowException()
        {
            VirgilConfig.Initialize(IntergrationHelper.AppAccessToken);
            VirgilConfig.SetKeyStorage(new KeyStorageFake());

            // Application Credentials

            var appKey = VirgilKey.FromFile(IntergrationHelper.AppKeyPath, IntergrationHelper.AppKeyPassword);
            var appID  = IntergrationHelper.AppID;

            // Create a Virgil Card

            var          identity = "Alice-" + Guid.NewGuid();
            const string type     = "member";

            var aliceKey = VirgilKey.Create("alice_key");
            var request  = aliceKey.BuildCardRequest(identity, type);

            appKey.SignRequest(request, appID);
            var aliceCard = await VirgilCard.CreateAsync(request);

            // Revoke a Virgil Card

            await IntergrationHelper.RevokeCard(aliceCard.Id);

            aliceKey.Destroy();

            Assert.ThrowsAsync <VirgilClientException>(async() => await VirgilCard.GetAsync(aliceCard.Id));
        }
Ejemplo n.º 2
0
 public static VirgilKey GetVirgilAppKey()
 {
     return(VirgilKey.FromFile(AppKeyPath, AppKeyPassword));
 }