Ncamillucci/keys 2026 01 01 preview v4#47591
Conversation
e10efe8 to
9417660
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR adds support for the Secure Wrap and Secure Unwrap key operations (available in API version 2026-01-01-preview and newer) to the Azure Key Vault Keys library. It introduces new secure_wrap_key/secure_unwrap_key methods on both the sync and async CryptographyClient, the KeySecureWrapAlgorithm enum, and SecureWrapResult/SecureUnwrapResult result models, along with samples and tests.
Changes:
- Added
secure_wrap_key/secure_unwrap_keymethods to sync and asyncCryptographyClient, plus theKeySecureWrapAlgorithmenum andSecureWrapResult/SecureUnwrapResultmodels, with public exports. - Added sync/async samples demonstrating the secure wrap/unwrap flow against a Managed HSM.
- Added sync/async tests for the new operations and updated the CHANGELOG and recorded test assets.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crypto/_enums.py |
Adds KeySecureWrapAlgorithm enum. |
crypto/_models.py |
Adds SecureWrapResult and SecureUnwrapResult models. |
crypto/_client.py |
Adds sync secure_wrap_key/secure_unwrap_key. |
crypto/aio/_client.py |
Adds async secure_wrap_key/secure_unwrap_key. |
crypto/__init__.py |
Exports new enum and result models. |
crypto/aio/__init__.py |
Lazy-loads new enum and result models in the aio namespace. |
tests/test_crypto_client.py |
Adds sync secure wrap/unwrap test. |
tests/test_crypto_client_async.py |
Adds async secure wrap/unwrap test and key_operations override. |
tests/test_examples_crypto.py |
Adds sync sample-snippet test. |
tests/test_examples_crypto_async.py |
Adds async sample-snippet test. |
samples/secure_key_operations.py |
New sync sample. |
samples/secure_key_operations_async.py |
New async sample. |
assets.json |
Updates recorded test asset tag. |
CHANGELOG.md |
Documents the new features. |
|
|
||
| ### Features Added | ||
|
|
||
| - Added `secure_wrap_key` and `secure_unwrap_key` methods for wrap/unwrap operations on keys [#47200](https://github.com/Azure/azure-sdk-for-python/pull/47591). |
d3e4e28 to
cb5ad5a
Compare
Description
secure_wrap_keyandsecure_unwrap_keymethods for wrap/unwrap operations on keys.KeySecureWrapAlgorithmenum, listing the algorithms supported by the secure wrap/unwrap operations.SecureWrapResultandSecureUnwrapResultmodel classes wrapping the results ofsecure_wrap_keyandsecure_unwrap_key, respectively.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines