protected virtual void Dispose(bool disposing)
 {
     this.leaf?.Dispose();
     this.chain[0]?.Dispose();
     X509CertificateOperations.RemoveCertsByOrganizationName(
         StoreName.My,
         StoreLocation.CurrentUser,
         "Fabrikam Drone Delivery");
     X509CertificateOperations.RemoveCertsByOrganizationName(
         StoreName.Root,
         StoreLocation.CurrentUser,
         "Fabrikam Drone Delivery");
     deviceHSM?.Dispose();
 }
Beispiel #2
0
        private static void CleanupStore()
        {
            Console.Write("Clean up X509 Cert Personal Store...");
            X509CertificateOperations.RemoveCertsByOrganizationName(
                StoreName.My,
                StoreLocation.CurrentUser,
                "Fabrikam Drone Delivery");
            Console.Write("OK!\n");

            Console.Write("Clean up X509 Cert CA Store...");
            X509CertificateOperations.RemoveCertsByOrganizationName(
                StoreName.CertificateAuthority,
                StoreLocation.CurrentUser,
                "Fabrikam Drone Delivery");
            Console.Write("OK!\n");

            Console.Write("Clean up X509 Cert Root Store...");
            X509CertificateOperations.RemoveCertsByOrganizationName(
                StoreName.Root,
                StoreLocation.CurrentUser,
                "Fabrikam Drone Delivery");
            Console.Write("OK!\n");
        }