KeyClient.GetCryptographyClient(String, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get a CryptographyClient for the given key.
public virtual Azure.Security.KeyVault.Keys.Cryptography.CryptographyClient GetCryptographyClient (string keyName, string keyVersion = default);
abstract member GetCryptographyClient : string * string -> Azure.Security.KeyVault.Keys.Cryptography.CryptographyClient
override this.GetCryptographyClient : string * string -> Azure.Security.KeyVault.Keys.Cryptography.CryptographyClient
Public Overridable Function GetCryptographyClient (keyName As String, Optional keyVersion As String = Nothing) As CryptographyClient
Parameters
- keyName
- String
The name of the key used to perform cryptographic operations.
- keyVersion
- String
Optional version of the key used to perform cryptographic operations.
Returns
A CryptographyClient using the same options and pipeline as this KeyClient.
Exceptions
keyName
is an empty string.
keyName
is null.
Remarks
Given a key keyName
and optional keyVersion
, a new CryptographyClient will be created using the same VaultUri and options passed to this KeyClient, including the KeyClientOptions.ServiceVersion, Diagnostics, Retry, and other options.
If you want to create a CryptographyClient using a different Key Vault or Managed HSM endpoint, with different options, or even with a JsonWebKey you already have acquired, you can create a CryptographyClient directly with any of those alternatives.