KeyProperties Class

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

Implements

public class KeyProperties
implements JsonSerializable<KeyProperties>

KeyProperties is the resource containing all the properties of the key except its JsonWebKey material. It is managed by the Key Service.

Constructor Summary

Constructor Description
KeyProperties()

Creates a new instance of KeyProperties.

Method Summary

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

Reads a JSON stream into a KeyProperties.

OffsetDateTime getCreatedOn()

Get the time at which key was created in UTC.

OffsetDateTime getExpiresOn()

Get the key expiration time in UTC.

String getHsmPlatform()

Get the underlying HSM Platform the key was generated with.

String getId()

Get the key identifier.

String getName()

Get the key name.

OffsetDateTime getNotBefore()

Get the key's notBefore time in UTC.

Integer getRecoverableDays()

Gets the number of days a key is retained before being deleted for a soft delete-enabled Key Vault.

String getRecoveryLevel()

Get the key recovery level.

KeyReleasePolicy getReleasePolicy()

Get the policy rules under which the key can be exported.

Map<String,String> getTags()

Get the tags associated with the key.

OffsetDateTime getUpdatedOn()

Get the time at which key was last updated in UTC.

String getVersion()

Get the version of the key.

Boolean isEnabled()

Get the enabled value.

Boolean isExportable()

Get a flag that indicates if the private key can be exported.

Boolean isManaged()

Get the managed value.

KeyProperties setEnabled(Boolean enabled)

Set a value that indicates if the key is enabled.

KeyProperties setExpiresOn(OffsetDateTime expiresOn)

Set the key expiration time in UTC.

KeyProperties setExportable(Boolean exportable)

Set a flag that indicates if the private key can be exported.

KeyProperties setNotBefore(OffsetDateTime notBefore)

Set the key's notBefore time in UTC.

KeyProperties setReleasePolicy(KeyReleasePolicy releasePolicy)

Set the policy rules under which the key can be exported.

KeyProperties setTags(Map<String,String> tags)

Set the tags to be associated with the key.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

KeyProperties

public KeyProperties()

Creates a new instance of KeyProperties.

Method Details

fromJson

public static KeyProperties fromJson(JsonReader jsonReader)

Reads a JSON stream into a KeyProperties.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of KeyProperties that the JSON stream represented, may return null.

Throws:

IOException

- If a KeyProperties fails to be read from the jsonReader.

getCreatedOn

public OffsetDateTime getCreatedOn()

Get the time at which key was created in UTC.

Returns:

The time at which key was created in UTC.

getExpiresOn

public OffsetDateTime getExpiresOn()

Get the key expiration time in UTC.

Returns:

The key expiration time in UTC.

getHsmPlatform

public String getHsmPlatform()

Get the underlying HSM Platform the key was generated with.

Returns:

The key's underlying HSM Platform.

getId

public String getId()

Get the key identifier.

Returns:

The key identifier.

getName

public String getName()

Get the key name.

Returns:

The name of the key.

getNotBefore

public OffsetDateTime getNotBefore()

Get the key's notBefore time in UTC.

Returns:

The key's notBefore time in UTC.

getRecoverableDays

public Integer getRecoverableDays()

Gets the number of days a key is retained before being deleted for a soft delete-enabled Key Vault.

Returns:

The recoverable days.

getRecoveryLevel

public String getRecoveryLevel()

Get the key recovery level.

Returns:

The key recovery level.

getReleasePolicy

public KeyReleasePolicy getReleasePolicy()

Get the policy rules under which the key can be exported.

Returns:

The policy rules under which the key can be exported.

getTags

public Map getTags()

Get the tags associated with the key.

Returns:

The tag names and values.

getUpdatedOn

public OffsetDateTime getUpdatedOn()

Get the time at which key was last updated in UTC.

Returns:

The time at which key was last updated in UTC.

getVersion

public String getVersion()

Get the version of the key.

Returns:

The version of the key.

isEnabled

public Boolean isEnabled()

Get the enabled value.

Returns:

The enabled value.

isExportable

public Boolean isExportable()

Get a flag that indicates if the private key can be exported.

Returns:

A flag that indicates if the private key can be exported.

isManaged

public Boolean isManaged()

Get the managed value.

Returns:

The managed value.

setEnabled

public KeyProperties setEnabled(Boolean enabled)

Set a value that indicates if the key is enabled.

Parameters:

enabled - The enabled value to set.

Returns:

The updated KeyProperties object.

setExpiresOn

public KeyProperties setExpiresOn(OffsetDateTime expiresOn)

Set the key expiration time in UTC.

Parameters:

expiresOn - The key expiration time in UTC.

Returns:

The updated KeyProperties object.

setExportable

public KeyProperties setExportable(Boolean exportable)

Set a flag that indicates if the private key can be exported.

Parameters:

exportable - A flag that indicates if the private key can be exported.

Returns:

The updated KeyProperties object.

setNotBefore

public KeyProperties setNotBefore(OffsetDateTime notBefore)

Set the key's notBefore time in UTC.

Parameters:

notBefore - The key's notBefore time in UTC.

Returns:

The updated KeyProperties object.

setReleasePolicy

public KeyProperties setReleasePolicy(KeyReleasePolicy releasePolicy)

Set the policy rules under which the key can be exported.

Parameters:

releasePolicy - The policy rules to set.

Returns:

The updated KeyProperties object.

setTags

public KeyProperties setTags(Map tags)

Set the tags to be associated with the key.

Parameters:

tags - The tags to set.

Returns:

The updated KeyProperties object.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to