KeyReleasePolicy Class

  • java.lang.Object
    • com.azure.security.keyvault.keys.models.KeyReleasePolicy

Implements

public final class KeyReleasePolicy
implements JsonSerializable<KeyReleasePolicy>

A model that represents the policy rules under which the key can be exported.

Constructor Summary

Constructor Description
KeyReleasePolicy(BinaryData encodedPolicy)

Creates an instance of KeyReleasePolicy.

Method Summary

Modifier and Type Method and Description
static KeyReleasePolicy fromJson(JsonReader jsonReader)

Reads a JSON stream into a KeyReleasePolicy.

String getContentType()

Get the content type and version of key release policy.

BinaryData getEncodedPolicy()

Get a blob encoding the policy rules under which the key can be released.

Boolean isImmutable()

Get a value indicating if the policy is immutable.

KeyReleasePolicy setContentType(String contentType)

Set the content type and version of key release policy.

KeyReleasePolicy setImmutable(Boolean immutable)

Get a value indicating if the policy is immutable.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

KeyReleasePolicy

public KeyReleasePolicy(BinaryData encodedPolicy)

Creates an instance of KeyReleasePolicy.

Parameters:

encodedPolicy - The policy rules under which the key can be released. Encoded based on the KeyReleasePolicy#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

fromJson

public static KeyReleasePolicy fromJson(JsonReader jsonReader)

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.

getContentType

public String getContentType()

Get the content type and version of key release policy.

Returns:

The content type and version of key release policy.

getEncodedPolicy

public 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 KeyReleasePolicy#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.

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.

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.

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 JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to