Skip to content

Commit 61fe976

Browse files
committed
Address feedback
1 parent bcfae40 commit 61fe976

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sdk/keyvault/azure-keyvault-keys/migration_guide.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ credential = DefaultAzureCredential()
7474
key_client = KeyClient(vault_url="https://my-key-vault.vault.azure.net/", credential=credential)
7575
```
7676

77-
You can also create a `CryptographyClient` to enable cryptographic operations (encrypt/decrypt, wrap/unwrap, sign/verify) using a particular key.
77+
You can also create a `CryptographyClient` to perform cryptographic operations (encrypt/decrypt, wrap/unwrap, sign/verify) using a particular key.
7878

7979
```python
8080
from azure.keyvault.keys.crypto import CryptographyClient
@@ -108,7 +108,7 @@ async with client:
108108

109109
### Create a key
110110

111-
In `azure-keyvault` you could create a key by using `KeyVaultClient`'s `create_key` method, which required a vault endpoint, key name, and key type. This method returned a `KeyBundle` contianing the key.
111+
In `azure-keyvault` you could create a key by using `KeyVaultClient`'s `create_key` method, which required a vault endpoint, key name, and key type. This method returned a `KeyBundle` containing the key.
112112

113113
```python
114114
# create an RSA key
@@ -131,16 +131,18 @@ key = key_bundle.key
131131
Now in `azure-keyvault-keys` there are multiple ways to create keys. You can provide a key name and type to the general `create_key` method, or provide just a name to `create_rsa_key` or `create_ec_key`. These methods all return the created key as a `KeyVaultKey`.
132132

133133
```python
134+
from azure.keyvault.keys import KeyType, KeyCurveName
135+
134136
# create a key with specified type
135-
key = key_client.create_key(name="key-name", key_type="oct")
137+
key = key_client.create_key(name="key-name", key_type=KeyType.ec)
136138
print(key.name)
137139
print(key.key_type)
138140

139141
# create an RSA key
140142
rsa_key = key_client.create_rsa_key(name="rsa-key-name", size=2048)
141143

142144
# create an elliptic curve key
143-
ec_key = key_client.create_ec_key(name="ec-key-name", curve="P-256")
145+
ec_key = key_client.create_ec_key(name="ec-key-name", curve=KeyCurveName.p_256)
144146
```
145147

146148
### Retrieve a key
@@ -250,7 +252,7 @@ operation_result = client.encrypt(
250252
ciphertext = operation_result.result
251253
```
252254

253-
Now in `azure-keyvault-keys` you can perform these cryptographic operations by using a `CryptographyClient`. The key used to create the client will be used for these operations.
255+
Now in `azure-keyvault-keys` you can perform these cryptographic operations by using a `CryptographyClient`. The key used to create the client will be used for these operations. Cryptographic operations are now performed locally by the client, rather than remotely by Key Vault.
254256

255257
```python
256258
from azure.keyvault.keys.crypto import CryptographyClient, EncryptionAlgorithm

0 commit comments

Comments
 (0)