Closed bcaradec closed 3 years ago
Thank you for opening this issue! I have a fix and am working on a patch release. In the meantime, I think the best workaround is to use the prior version (4.2.0). The only new feature in 4.3.0 is that CryptographyClient can decrypt and sign locally.
azure-keyvault-keys 4.3.1 is available now with a fix for this. Thanks again for opening this issue. Please open another if you encounter other problems, and feel free to reopen this issue if you see this error again with version 4.3.1.
Thanks Charles for the quick fix, much appreciated! Fix has been successfully tested. Greatings from Germany Bertrand
Describe the bug After instantiating an azure.keyvault.keys.crypto.CryptographyClient object using a key as URL of a Key Vault Key, the call to wrap_key() conducts to the following exception:
File "/home/bcaradec/.virtualenvs/b-id_386_env/lib/python3.8/site-packages/azure/core/tracing/decorator.py", line 83, in wrapper_use_tracer return func(args, kwargs) File "/home/bcaradec/.virtualenvs/b-id_386_env/lib/python3.8/site-packages/azure/keyvault/keys/crypto/_client.py", line 196, in wrap_key self._initialize(kwargs) File "/home/bcaradec/.virtualenvs/b-id_386_env/lib/python3.8/site-packages/azure/core/tracing/decorator.py", line 83, in wrapper_use_tracer return func(args, kwargs) File "/home/bcaradec/.virtualenvs/b-id_386_env/lib/python3.8/site-packages/azure/keyvault/keys/crypto/_client.py", line 100, in _initialize self._local_provider = get_local_cryptography_provider(self._key) File "/home/bcaradec/.virtualenvs/b-id_386_env/lib/python3.8/site-packages/azure/keyvault/keys/crypto/_providers/init.py", line 19, in get_local_cryptography_provider if key.key_type in (KeyType.ec, KeyType.ec_hsm): AttributeError: 'KeyBundle' object has no attribute 'key_type'**
To Reproduce Steps to reproduce the behavior: my_crypto_client=CryptographyClient(key="https://mykv.vault.azure.net/keys/mykeyname/myversionnr
", credential=DefaultAzureCredential( exclude_visual_studio_code_credential=True, exclude_interactive_browser_credential=True, logging_enable=True, ))
Expected behavior Succesful wrapping
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.