Пример #1
0
 public void CanAddKeyCommandUrlWithTrailingSlashAndVersionNumberTest()
 {
     var key = new Key("https://test.vault.azure.net/keys/TestKey/0f653b06c1d94159bc7090596bbf7784/");
     Assert.AreEqual(key.Name, "TestKey");
     Assert.AreEqual(key.Version, "0f653b06c1d94159bc7090596bbf7784");
     Assert.AreEqual(key.VaultName, "test");
 }
Пример #2
0
 public void CanAddKeyCommandUrlWithTrailingSlashAndNoVersionNumberTest()
 {
     var key = new Key("https://test.vault.azure.net/keys/TestKey/");
     Assert.AreEqual(key.Name, "TestKey");
     Assert.IsNull(key.Version);
     Assert.AreEqual(key.VaultName, "test");
 }
 public async Task<bool> Add(Key key)
 {
     await this.keyVaultClient.CreateKeyAsync(
        this.keyVaultConfiguration.AzureKeyVaultUrl,
        key.Name,
        key.KeyType);
     return true;
 }
 public KeyAddedEventArgs(Key key)
 {
     this.Key = key;
 }
 public async Task<bool> Delete(Key key)
 {
     await this.keyVaultClient.DeleteKeyAsync(this.keyVaultConfiguration.AzureKeyVaultUrl, key.Name);
     return true;
 }
 public void SetSelectedKey(Key key)
 {
     this.SelectedKey = key;
     this.DeleteKeyCommand.RaiseCanExecuteChanged();
 }