Beispiel #1
0
 /// <summary>
 /// List the next page of versions of a key
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static KeyOpResponseMessageWithRawJsonContent ListVersionsNext(this IKeyOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IKeyOperations)s).ListVersionsNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new, named, key in the specified vault.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='vault'>
 /// Required.
 /// </param>
 /// <param name='keyName'>
 /// Required.
 /// </param>
 /// <param name='keyOpRequest'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static KeyOpResponseMessageWithRawJsonContent Create(this IKeyOperations operations, string vault, string keyName, KeyOpRequestMessageWithRawJsonContent keyOpRequest)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IKeyOperations)s).CreateAsync(vault, keyName, keyOpRequest);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #3
0
 /// <summary>
 /// Requests that a backup of the specified key be downloaded to the
 /// client.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='keyIdentifier'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static KeyOpResponseMessageWithRawJsonContent Backup(this IKeyOperations operations, string keyIdentifier)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IKeyOperations)s).BackupAsync(keyIdentifier);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 public KeyCryptographicOperationsViewModel(IKeyOperations keyOperations)
 {
     this.keyOperations = keyOperations;
     this.SelectedDataConverter = new Base64DataConverter();
     this.EncryptedString = this.SelectedDataConverter.DisplayMessage;
     this.EncryptCommand = new RelayCommand(this.OnEncryptCommand, this.CanExecuteCommand);
     this.DecryptCommand = new RelayCommand(this.OnDecryptCommand, this.CanExecuteCommand);
     this.CopyToClipboardCommand = new RelayCommand(this.OnCopyToClipboardCommand);
 }
 public KeyCryptographicOperationsViewModel(IKeyOperations keyOperations)
 {
     this.keyOperations          = keyOperations;
     this.SelectedDataConverter  = new Base64DataConverter();
     this.EncryptedString        = this.SelectedDataConverter.DisplayMessage;
     this.EncryptCommand         = new RelayCommand(this.OnEncryptCommand, this.CanExecuteCommand);
     this.DecryptCommand         = new RelayCommand(this.OnDecryptCommand, this.CanExecuteCommand);
     this.CopyToClipboardCommand = new RelayCommand(this.OnCopyToClipboardCommand);
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the KeyVaultInternalClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public KeyVaultInternalClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._keys       = new KeyOperations(this);
     this._secrets    = new SecretOperations(this);
     this._apiVersion = "2015-06-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Beispiel #7
0
        public U2FClient([NotNull] ISender sender, [CanBeNull] CheckAppIdOrOrigin originChecker,
                         [CanBeNull] CheckAppIdOrOrigin appIdChecker, [NotNull] IKeyOperations keyOperations,
                         [NotNull] IClientCrypto crypto)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }
            if (keyOperations == null)
            {
                throw new ArgumentNullException(nameof(keyOperations));
            }
            if (crypto == null)
            {
                throw new ArgumentNullException(nameof(crypto));
            }

            this.sender        = sender;
            this.originChecker = originChecker ?? NoAppIdOrOriginCheck;
            this.appIdChecker  = appIdChecker ?? NoAppIdOrOriginCheck;
            this.keyOperations = keyOperations;
            this.crypto        = crypto;
        }
Beispiel #8
0
 /// <summary>
 /// Wraps a symmetric key using the specified key
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='keyIdentifier'>
 /// Required.
 /// </param>
 /// <param name='keyOpRequest'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static Task <KeyOpResponseMessageWithRawJsonContent> WrapKeyAsync(this IKeyOperations operations, string keyIdentifier, KeyOpRequestMessageWithRawJsonContent keyOpRequest)
 {
     return(operations.WrapKeyAsync(keyIdentifier, keyOpRequest, CancellationToken.None));
 }
Beispiel #9
0
 /// <summary>
 /// Requests that a backup of the specified key be downloaded to the
 /// client.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='keyIdentifier'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static Task <KeyOpResponseMessageWithRawJsonContent> BackupAsync(this IKeyOperations operations, string keyIdentifier)
 {
     return(operations.BackupAsync(keyIdentifier, CancellationToken.None));
 }
Beispiel #10
0
 /// <summary>
 /// Restores the backup key in to a vault
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='vault'>
 /// Required.
 /// </param>
 /// <param name='keyOpRequest'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static Task <KeyOpResponseMessageWithRawJsonContent> RestoreAsync(this IKeyOperations operations, string vault, KeyOpRequestMessageWithRawJsonContent keyOpRequest)
 {
     return(operations.RestoreAsync(vault, keyOpRequest, CancellationToken.None));
 }
Beispiel #11
0
 /// <summary>
 /// List the next page of versions of a key
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static Task <KeyOpResponseMessageWithRawJsonContent> ListVersionsNextAsync(this IKeyOperations operations, string nextLink)
 {
     return(operations.ListVersionsNextAsync(nextLink, CancellationToken.None));
 }
Beispiel #12
0
 /// <summary>
 /// List the versions of a key
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='vault'>
 /// Required.
 /// </param>
 /// <param name='keyName'>
 /// Required.
 /// </param>
 /// <param name='top'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static Task <KeyOpResponseMessageWithRawJsonContent> ListVersionsAsync(this IKeyOperations operations, string vault, string keyName, int?top)
 {
     return(operations.ListVersionsAsync(vault, keyName, top, CancellationToken.None));
 }
Beispiel #13
0
 /// <summary>
 /// Delete the specified key
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.KeyVault.Internal.IKeyOperations.
 /// </param>
 /// <param name='vault'>
 /// Required.
 /// </param>
 /// <param name='keyName'>
 /// Required.
 /// </param>
 /// <returns>
 /// Represents the response to a key operation request.
 /// </returns>
 public static Task <KeyOpResponseMessageWithRawJsonContent> DeleteKeyAsync(this IKeyOperations operations, string vault, string keyName)
 {
     return(operations.DeleteKeyAsync(vault, keyName, CancellationToken.None));
 }
Beispiel #14
0
        public U2FClient([NotNull] ISender sender, [CanBeNull] CheckAppIdOrOrigin originChecker,
            [CanBeNull] CheckAppIdOrOrigin appIdChecker, [NotNull] IKeyOperations keyOperations,
            [NotNull] IClientCrypto crypto)
        {
            if (sender == null)
            {
                throw new ArgumentNullException(nameof(sender));
            }
            if (keyOperations == null)
            {
                throw new ArgumentNullException(nameof(keyOperations));
            }
            if (crypto == null)
            {
                throw new ArgumentNullException(nameof(crypto));
            }

            this.sender = sender;
            this.originChecker = originChecker ?? NoAppIdOrOriginCheck;
            this.appIdChecker = appIdChecker ?? NoAppIdOrOriginCheck;
            this.keyOperations = keyOperations;
            this.crypto = crypto;
        }
Beispiel #15
0
 public U2FClient([NotNull] ISender sender, [NotNull] IKeyOperations keyOperations)
     : this(sender, null, null, keyOperations, BouncyCastleClientCrypto.Instance)
 {
 }