Beispiel #1
0
 private void DeleteKey()
 {
     using (NCryptStorageProvider provider = new NCryptStorageProvider(SelectProvider()))
     {
         using (NCryptKey key = provider.OpenKey(SelectKey(provider)))
         {
             key.Delete();
         }
     }
 }
Beispiel #2
0
        public Boolean DeleteKey(String keyName, Boolean machineKeyFlag = false)
        {
            NCryptKey key = OpenKey(keyName, machineKeyFlag);

            if (!(key is null))
            {
                key.Delete();
                return(true);
            }
            return(false);
        }