Class KeyProperties

java.lang.Object
com.azure.security.keyvault.keys.models.KeyProperties
All Implemented Interfaces:
com.azure.json.JsonSerializable<KeyProperties>
Direct Known Subclasses:
ImportKeyOptions

public class KeyProperties extends Object implements com.azure.json.JsonSerializable<KeyProperties>
KeyProperties is the resource containing all the properties of the key except its JsonWebKey material. It is managed by the Key Service.
See Also:
  • Constructor Details

    • KeyProperties

      public KeyProperties()
      Creates a new instance of KeyProperties.
  • Method Details

    • 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.
    • 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.
    • 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.
    • getRecoveryLevel

      public String getRecoveryLevel()
      Get the key recovery level.
      Returns:
      The key recovery level.
    • getName

      public String getName()
      Get the key name.
      Returns:
      The name of the key.
    • isEnabled

      public Boolean isEnabled()
      Get the enabled value.
      Returns:
      The enabled 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.
    • 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.
    • 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.
    • getNotBefore

      public OffsetDateTime getNotBefore()
      Get the key's notBefore time in UTC.
      Returns:
      The key's notBefore time in UTC.
    • 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.
    • getExpiresOn

      public OffsetDateTime getExpiresOn()
      Get the key expiration time in UTC.
      Returns:
      The key expiration time in UTC.
    • 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.
    • getCreatedOn

      public OffsetDateTime getCreatedOn()
      Returns:
      The time at which key was created in UTC.
    • getUpdatedOn

      public OffsetDateTime getUpdatedOn()
      Returns:
      The time at which key was last updated in UTC.
    • getId

      public String getId()
      Get the key identifier.
      Returns:
      The key identifier.
    • getTags

      public Map<String,String> getTags()
      Get the tags associated with the key.
      Returns:
      The tag names and values.
    • setTags

      public KeyProperties setTags(Map<String,String> tags)
      Set the tags to be associated with the key.
      Parameters:
      tags - The tags to set.
      Returns:
      The updated KeyProperties object.
    • isManaged

      public Boolean isManaged()
      Get the managed value.
      Returns:
      The managed value.
    • getVersion

      public String getVersion()
      Get the version of the key.
      Returns:
      The version of the key.
    • getHsmPlatform

      public String getHsmPlatform()
      Get the underlying HSM Platform the key was generated with.
      Returns:
      The key's underlying HSM Platform.
    • getKeyAttestation

      public KeyAttestation getKeyAttestation()
      Get the key attestation information.
      Returns:
      The key attestation information.
    • toJson

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

      public static KeyProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.