示例#1
0
        /// <summary>
        /// Updates key attributes
        /// </summary>
        /// <param name="keyName"> a global key identifier of the key to update </param>
        /// <returns> updated key bundle </returns>
        private static KeyBundle UpdateKey(string keyName)
        {
            var vaultAddress = inputValidator.GetVaultAddress();

            keyName = (keyName == string.Empty) ? inputValidator.GetKeyId() : keyName;

            // Get key attribute to update
            var keyAttributes = inputValidator.GetUpdateKeyAttribute();
            var updatedKey    = keyVaultClient.UpdateKeyAsync(vaultAddress, keyName, attributes: keyAttributes).GetAwaiter().GetResult();

            Console.Out.WriteLine("Updated key:---------------");
            PrintoutKey(updatedKey);

            return(updatedKey);
        }