Пример #1
0
        /// <summary>
        /// Delete a key from a key container
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="keyContainerName"/> is null
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// If the key container could not be deleted
        /// </exception>
        /// <param name="keyContainerName">name of the key container to delete</param>
        public static void DeleteKey(string keyContainerName)
        {
            if (string.IsNullOrEmpty(keyContainerName))
            {
                throw new ArgumentNullOrEmptyException("keyContainerName");
            }

            if (!StrongNameNative.StrongNameKeyDelete(keyContainerName))
            {
                Marshal.ThrowExceptionForHR(StrongNameNative.StrongNameErrorInfo());
            }
        }