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 Details

    • KeyReleasePolicy

      public KeyReleasePolicy(com.azure.core.util.BinaryData encodedPolicy)
      Creates an instance of KeyReleasePolicy.
      Parameters:
      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.

  • 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

      public String getContentType()
      Get the content type and version of key release policy.
      Returns:
      The content type and version of key release policy.
    • setContentType

      public KeyReleasePolicy setContentType(String contentType)
      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

      public Boolean 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

      public KeyReleasePolicy setImmutable(Boolean immutable)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<KeyReleasePolicy>
      Throws:
      IOException
    • fromJson

      public static KeyReleasePolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads a JSON stream into a KeyReleasePolicy.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of KeyReleasePolicy that the JSON stream represented, may return null.
      Throws:
      IOException - If a KeyReleasePolicy fails to be read from the jsonReader.