CreateExternalKeyOptions Class
- java.
lang. Object - com.
azure. security. keyvault. keys. models. CreateKeyOptions - com.
azure. security. keyvault. keys. models. CreateExternalKeyOptions
- com.
- com.
public class CreateExternalKeyOptions
extends CreateKeyOptions
Represents the configurable options to register an external key with Azure Key Vault Managed HSM.
An external key references key material that is owned by an external Hardware Security Module (HSM). Unlike other key types, an external key does not have a KeyType; the material is managed by the external HSM and the Managed HSM stores only a reference to it. External keys are mutually exclusive with a key type, so use createExternalKey(CreateExternalKeyOptions createExternalKeyOptions) (or its asynchronous equivalent createExternalKey(CreateExternalKeyOptions createExternalKeyOptions)) rather than the standard create key operations.
External keys are only supported on Managed HSM configured to use External Key Management (EKM), with service version 2026-04-01 or newer. They are not supported on a standard Key Vault.
Constructor Summary
| Constructor | Description |
|---|---|
| CreateExternalKeyOptions(String name, ExternalKey externalKey) |
Creates an instance of CreateExternalKeyOptions with |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
External |
getExternalKey()
Get the reference to the external key material. |
|
Create |
setEnabled(Boolean enabled)
Set a value that indicates if the key is enabled. |
|
Create |
setExpiresOn(OffsetDateTime expiresOn)
Set the expires UTC time. |
|
Create |
setExportable(Boolean exportable)
Set a flag that indicates if the private key can be exported. |
|
Create |
setKeyOperations(KeyOperation[] keyOperations)
Set the key operations. |
|
Create |
setNotBefore(OffsetDateTime notBefore)
Set the notBefore UTC time. |
|
Create |
setReleasePolicy(KeyReleasePolicy releasePolicy)
Set the policy rules under which the key can be exported. |
|
Create |
setTags(Map<String,String> tags)
Set the tags to be associated with the key. |
Methods inherited from CreateKeyOptions
Methods inherited from java.lang.Object
Constructor Details
CreateExternalKeyOptions
public CreateExternalKeyOptions(String name, ExternalKey externalKey)
Creates an instance of CreateExternalKeyOptions with name as the key name and externalKey as the reference to the external key material.
Parameters:
Method Details
getExternalKey
public ExternalKey getExternalKey()
Get the reference to the external key material.
Returns:
setEnabled
public CreateExternalKeyOptions setEnabled(Boolean enabled)
Set a value that indicates if the key is enabled.
Overrides:
CreateExternalKeyOptions.setEnabled(Boolean enabled)Parameters:
Returns:
setExpiresOn
public CreateExternalKeyOptions setExpiresOn(OffsetDateTime expiresOn)
Set the expires UTC time.
Overrides:
CreateExternalKeyOptions.setExpiresOn(OffsetDateTime expiresOn)Parameters:
Returns:
setExportable
public CreateExternalKeyOptions setExportable(Boolean exportable)
Set a flag that indicates if the private key can be exported.
Overrides:
CreateExternalKeyOptions.setExportable(Boolean exportable)Parameters:
Returns:
setKeyOperations
public CreateExternalKeyOptions setKeyOperations(KeyOperation[] keyOperations)
Set the key operations.
Overrides:
CreateExternalKeyOptions.setKeyOperations(KeyOperation[] keyOperations)Parameters:
Returns:
setNotBefore
public CreateExternalKeyOptions setNotBefore(OffsetDateTime notBefore)
Set the notBefore UTC time.
Overrides:
CreateExternalKeyOptions.setNotBefore(OffsetDateTime notBefore)Parameters:
Returns:
setReleasePolicy
public CreateExternalKeyOptions setReleasePolicy(KeyReleasePolicy releasePolicy)
Set the policy rules under which the key can be exported.
Overrides:
CreateExternalKeyOptions.setReleasePolicy(KeyReleasePolicy releasePolicy)Parameters:
Returns:
setTags
public CreateExternalKeyOptions setTags(Map<String,String> tags)
Set the tags to be associated with the key.
Overrides:
CreateExternalKeyOptions.setTags(Map<String,String> tags)Parameters:
Returns: