Class KeyRotationPolicy
- java.lang.Object
-
- com.azure.security.keyvault.keys.models.KeyRotationPolicyProperties
-
- com.azure.security.keyvault.keys.models.KeyRotationPolicy
-
public final class KeyRotationPolicy extends KeyRotationPolicyProperties
The complete key rotation policy that belongs to a key.
-
-
Field Summary
-
Fields inherited from class com.azure.security.keyvault.keys.models.KeyRotationPolicyProperties
expiryTime, keyRotationLifetimeActions
-
-
Constructor Summary
Constructors Constructor Description KeyRotationPolicy(String id, OffsetDateTime createdOn, OffsetDateTime updatedOn)
Creates an instance ofKeyRotationPolicy
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OffsetDateTime
getCreatedOn()
Get thepolicy's
created time in UTC.String
getId()
Get the identifier of thepolicy
.OffsetDateTime
getUpdatedOn()
Get thepolicy's
last updated time in UTC.KeyRotationPolicy
setExpiryTime(String expiryTime)
Set the optional key expiration period used to define the duration after which a newly rotated key will expire.KeyRotationPolicy
setLifetimeActions(List<KeyRotationLifetimeAction> keyRotationLifetimeActions)
Set the actions that will be performed by Key Vault over the lifetime of a key.-
Methods inherited from class com.azure.security.keyvault.keys.models.KeyRotationPolicyProperties
getExpiryTime, getLifetimeActions
-
-
-
-
Constructor Detail
-
KeyRotationPolicy
public KeyRotationPolicy(String id, OffsetDateTime createdOn, OffsetDateTime updatedOn)
Creates an instance ofKeyRotationPolicy
.
-
-
Method Detail
-
getCreatedOn
public OffsetDateTime getCreatedOn()
- Returns:
- The
policy's
created time in UTC.
-
getUpdatedOn
public OffsetDateTime getUpdatedOn()
Get thepolicy's
last updated time in UTC.May be undefined if a
policy
has not been explicitly set.- Returns:
- The
policy's
last updated time in UTC.
-
setExpiryTime
public KeyRotationPolicy setExpiryTime(String expiryTime)
Set the optional key expiration period used to define the duration after which a newly rotated key will expire. It should be defined as an ISO 8601 duration. For example, 90 days would be formatted as follows: "P90D", 3 months would be "P3M", 48 hours would be "PT48H" and 1 year and 10 days would be "P1Y10D".- Overrides:
setExpiryTime
in classKeyRotationPolicyProperties
- Parameters:
expiryTime
- The expiry time to set in ISO 8601 format.- Returns:
- The updated
KeyRotationPolicy
object.
-
setLifetimeActions
public KeyRotationPolicy setLifetimeActions(List<KeyRotationLifetimeAction> keyRotationLifetimeActions)
Set the actions that will be performed by Key Vault over the lifetime of a key.You may also pass an empty array to restore to its default values.
- Overrides:
setLifetimeActions
in classKeyRotationPolicyProperties
- Parameters:
keyRotationLifetimeActions
- Theactions
to set.- Returns:
- The updated
KeyRotationPolicy
object.
-
-