你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

KeyVaultClientExtensions.CreateKeyAsync 方法

定义

重载

CreateKeyAsync(IKeyVaultClient, String, String, NewKeyParameters, CancellationToken)
CreateKeyAsync(IKeyVaultClient, String, String, String, Nullable<Int32>, IList<String>, KeyAttributes, IDictionary<String,String>, String, CancellationToken)

创建一个新密钥,存储该密钥,然后向客户端返回密钥参数和属性。

CreateKeyAsync(IKeyVaultClient, String, String, NewKeyParameters, CancellationToken)

Source:
KeyVaultClientExtensions.cs
public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle> CreateKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, Microsoft.Azure.KeyVault.Models.NewKeyParameters parameters, System.Threading.CancellationToken cancellationToken = default);
static member CreateKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * Microsoft.Azure.KeyVault.Models.NewKeyParameters * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle>
<Extension()>
Public Function CreateKeyAsync (operations As IKeyVaultClient, vaultBaseUrl As String, keyName As String, parameters As NewKeyParameters, Optional cancellationToken As CancellationToken = Nothing) As Task(Of KeyBundle)

参数

operations
IKeyVaultClient
vaultBaseUrl
String
keyName
String
parameters
NewKeyParameters
cancellationToken
CancellationToken

返回

适用于

CreateKeyAsync(IKeyVaultClient, String, String, String, Nullable<Int32>, IList<String>, KeyAttributes, IDictionary<String,String>, String, CancellationToken)

Source:
KeyVaultClientExtensions.cs

创建一个新密钥,存储该密钥,然后向客户端返回密钥参数和属性。

public static System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle> CreateKeyAsync (this Microsoft.Azure.KeyVault.IKeyVaultClient operations, string vaultBaseUrl, string keyName, string kty, int? keySize = default, System.Collections.Generic.IList<string> keyOps = default, Microsoft.Azure.KeyVault.Models.KeyAttributes keyAttributes = default, System.Collections.Generic.IDictionary<string,string> tags = default, string curve = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateKeyAsync : Microsoft.Azure.KeyVault.IKeyVaultClient * string * string * string * Nullable<int> * System.Collections.Generic.IList<string> * Microsoft.Azure.KeyVault.Models.KeyAttributes * System.Collections.Generic.IDictionary<string, string> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.KeyVault.Models.KeyBundle>
<Extension()>
Public Function CreateKeyAsync (operations As IKeyVaultClient, vaultBaseUrl As String, keyName As String, kty As String, Optional keySize As Nullable(Of Integer) = Nothing, Optional keyOps As IList(Of String) = Nothing, Optional keyAttributes As KeyAttributes = Nothing, Optional tags As IDictionary(Of String, String) = Nothing, Optional curve As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of KeyBundle)

参数

operations
IKeyVaultClient

此扩展方法的操作组。

vaultBaseUrl
String

保管库名称,例如 https://myvault.vault.azure.net

keyName
String

新密钥的名称。 系统将生成新密钥的版本名称。

kty
String

要创建的密钥类型。 有关有效值,请参阅 JsonWebKeyType。 可能的值包括:“EC”、“EC-HSM”、“RSA”、“RSA-HSM”、“oct”

keySize
Nullable<Int32>

密钥大小(以字节为单位)。 例如,1024 或 2048。

keyOps
IList<String>
keyAttributes
KeyAttributes
tags
IDictionary<String,String>

键/值对形式的应用程序特定元数据。

curve
String

椭圆曲线名称。 有关有效值,请参阅 JsonWebKeyCurveName。 可能的值包括:“P-256”、“P-384”、“P-521”、“SECP256K1”

cancellationToken
CancellationToken

取消标记。

返回

注解

创建密钥操作可用于在 Azure 密钥保管库中创建任何密钥类型。 如果命名的密钥已存在,Azure 密钥保管库将创建该密钥的新版本。 它需要密钥/创建权限。

适用于