public void Remover(string userId) { try { var list = fabric_ca_client.GetHFCAIdentities(admin); var user = list.FirstOrDefault(x => x.EnrollmentId == userId); if (user != null) { var test = fabric_ca_client.NewHFCAIdentity(userId); var resp = test.Delete(admin); if (resp == 1) { if (File.Exists(Path.Combine(keyStorePath, userId))) { var file = SampleUser.Load(userId, keyStorePath); File.Delete(Path.Combine(keyStorePath, userId)); File.Delete(Path.Combine(keyStorePath, ((Enrollment)file.Enrollment).signingIdentity)); } } } } catch (Exception ex) { Console.WriteLine(ex); } }
public void TestHFCAIdentityCryptoNull() { HFCAClient client = HFCAClient.Create("http://localhost:99", null); client.CryptoSuite = null; client.NewHFCAIdentity("testid"); }
public void DeleteIdentityNoServerResponse() { HFCAClient client = HFCAClient.Create("http://localhost:99", null); client.CryptoSuite = crypto; HFCAIdentity ident = client.NewHFCAIdentity("testuser1"); ident.Delete(admin); }
public void TestHFCAIdentityNewInstance() { HFCAClient client = HFCAClient.Create("http://localhost:99", null); client.CryptoSuite = crypto; HFCAIdentity ident = client.NewHFCAIdentity("testid"); Assert.IsNotNull(ident); Assert.AreSame(typeof(HFCAIdentity), ident.GetType()); Assert.AreEqual(ident.EnrollmentId, "testid"); }
public void TestHFCAIdentityIDNull() { HFCAClient client = HFCAClient.Create("http://localhost:99", null); client.NewHFCAIdentity(null); }