Class KeyReleasePolicy
java.lang.Object
com.azure.security.keyvault.keys.models.KeyReleasePolicy
- All Implemented Interfaces:
com.azure.json.JsonSerializable<KeyReleasePolicy>
public final class KeyReleasePolicy
extends Object
implements com.azure.json.JsonSerializable<KeyReleasePolicy>
A model that represents the policy rules under which the key can be exported.
-
Constructor Summary
ConstructorsConstructorDescriptionKeyReleasePolicy
(com.azure.core.util.BinaryData encodedPolicy) Creates an instance ofKeyReleasePolicy
. -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyReleasePolicy
fromJson
(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aKeyReleasePolicy
.Get the content type and version of key release policy.com.azure.core.util.BinaryData
Get a blob encoding the policy rules under which the key can be released.Get a value indicating if the policy is immutable.setContentType
(String contentType) Set the content type and version of key release policy.setImmutable
(Boolean immutable) Get a value indicating if the policy is immutable.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
KeyReleasePolicy
public KeyReleasePolicy(com.azure.core.util.BinaryData encodedPolicy) Creates an instance ofKeyReleasePolicy
.- Parameters:
encodedPolicy
- The policy rules under which the key can be released. Encoded based on thecontentType
.For more information regarding the release policy grammar for Azure Key Vault, please refer to: - https://aka.ms/policygrammarkeys for Azure Key Vault release policy grammar. - https://aka.ms/policygrammarmhsm for Azure Managed HSM release policy grammar.
-
-
Method Details
-
getEncodedPolicy
public com.azure.core.util.BinaryData getEncodedPolicy()Get a blob encoding the policy rules under which the key can be released.- Returns:
- encodedPolicy The policy rules under which the key can be released. Encoded based on the
contentType
.For more information regarding the release policy grammar for Azure Key Vault, please refer to: - https://aka.ms/policygrammarkeys for Azure Key Vault release policy grammar. - https://aka.ms/policygrammarmhsm for Azure Managed HSM release policy grammar.
-
getContentType
Get the content type and version of key release policy.- Returns:
- The content type and version of key release policy.
-
setContentType
Set the content type and version of key release policy.The service default is "application/json; charset=utf-8".
- Parameters:
contentType
- The content type and version of key release policy to set.- Returns:
- The updated
KeyReleasePolicy
object.
-
isImmutable
Get a value indicating if the policy is immutable. Once marked immutable on the service side, this flag cannot be reset and the policy cannot be changed under any circumstances.- Returns:
- If the
KeyReleasePolicy
is immutable.
-
setImmutable
Get a value indicating if the policy is immutable. Defines the mutability state of the policy. Once marked immutable on the service side, this flag cannot be reset and the policy cannot be changed under any circumstances.- Parameters:
immutable
- The immutable value to set.- Returns:
- The updated
KeyReleasePolicy
object.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<KeyReleasePolicy>
- Throws:
IOException
-
fromJson
Reads a JSON stream into aKeyReleasePolicy
.- Parameters:
jsonReader
- TheJsonReader
being read.- Returns:
- An instance of
KeyReleasePolicy
that the JSON stream represented, may return null. - Throws:
IOException
- If aKeyReleasePolicy
fails to be read from thejsonReader
.
-