public virtual async Task <Response <Key> > ImportKeyAsync(KeyImportOptions keyImportOptions, CancellationToken cancellationToken = default) { if (keyImportOptions == default) { throw new ArgumentNullException(nameof(keyImportOptions)); } return(await SendRequestAsync(HttpPipelineMethod.Put, keyImportOptions, () => new Key(keyImportOptions.Name), cancellationToken, KeysPath, keyImportOptions.Name)); }
/// <summary> /// Imports an externally created key, stores it, and returns key parameters /// and attributes to the client. /// </summary> /// <remarks> /// The import key operation may be used to import any key type into an Azure /// Key Vault. If the named key already exists, Azure Key Vault creates a new /// version of the key. This operation requires the keys/import permission. /// </remarks> /// <param name="keyImportOptions">The key import configuration object containing information about the <see cref="JsonWebKey"/> being imported.</param> /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param> public virtual Response <Key> ImportKey(KeyImportOptions keyImportOptions, CancellationToken cancellationToken = default) { if (keyImportOptions == default) { throw new ArgumentNullException(nameof(keyImportOptions)); } return(SendRequest(RequestMethod.Put, keyImportOptions, () => new Key(keyImportOptions.Name), cancellationToken, KeysPath, keyImportOptions.Name)); }
public virtual async Task <Response <Key> > ImportKeyAsync(string name, JsonWebKey keyMaterial, CancellationToken cancellationToken = default) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException($"{nameof(name)} can't be empty or null"); } if (keyMaterial == default) { throw new ArgumentNullException(nameof(keyMaterial)); } var keyImportOptions = new KeyImportOptions(name, keyMaterial); return(await SendRequestAsync(HttpPipelineMethod.Put, keyImportOptions, () => new Key(name), cancellationToken, KeysPath, name)); }
public virtual async Task <Response <Key> > ImportKeyAsync(KeyImportOptions keyImportOptions, CancellationToken cancellationToken = default) { await Task.CompletedTask; throw new NotImplementedException(); }
public virtual Response <Key> ImportKey(KeyImportOptions keyImportOptions, CancellationToken cancellationToken = default) { throw new NotImplementedException(); }