KeyVaultKey Class
A key's attributes and cryptographic material.
Providing cryptographic material as keyword arguments:
from azure.keyvault.keys.models import KeyVaultKey
key_id = 'https://myvault.vault.azure.net/keys/my-key/my-key-version'
key_bytes = os.urandom(32)
key = KeyVaultKey(key_id, k=key_bytes, kty='oct', key_ops=['unwrapKey', 'wrapKey'])
Providing cryptographic material as a dictionary:
from azure.keyvault.keys.models import KeyVaultKey
key_id = 'https://myvault.vault.azure.net/keys/my-key/my-key-version'
key_bytes = os.urandom(32)
jwk = {'k': key_bytes, 'kty': 'oct', 'key_ops': ['unwrapKey', 'wrapKey']}
key = KeyVaultKey(key_id, jwk=jwk)
- Inheritance
-
builtins.objectKeyVaultKey
Constructor
KeyVaultKey(key_id: str, jwk: Dict[str, Any] | None = None, **kwargs)
Parameters
Name | Description |
---|---|
key_id
Required
|
Key Vault's identifier for the key. Typically a URI, e.g. https://myvault.vault.azure.net/keys/my-key/version |
jwk
|
The key's cryptographic material as a JSON Web Key (https://tools.ietf.org/html/rfc7517). This may be provided as a dictionary or keyword arguments. See <xref:azure.keyvault.keys.models.JsonWebKey> for field names. Default value: None
|
Attributes
id
key
The JSON Web Key (JWK) for the key.
Returns
Type | Description |
---|---|
The JSON Web Key (JWK) for the key. |
key_operations
Permitted operations. See KeyOperation for possible values.
Returns
Type | Description |
---|---|
str]
|
Permitted operations. See KeyOperation for possible values. |
key_type
The key's type. See KeyType for possible values.
Returns
Type | Description |
---|---|
The key's type. See KeyType for possible values. |
name
properties
Azure SDK for Python