KeyRotationPolicy Class

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

public final class KeyRotationPolicy

The complete key rotation policy that belongs to a key.

Constructor Summary

Constructor Description
KeyRotationPolicy()

Creates an instance of KeyRotationPolicy.

Method Summary

Modifier and Type Method and Description
OffsetDateTime getCreatedOn()

Get the policy's created time in UTC.

String getExpiresIn()

Get the optional key expiration period used to define the duration after which a newly rotated key will expire.

String getId()

Get the identifier of the policy.

List<KeyRotationLifetimeAction> getLifetimeActions()

Get the actions that will be performed by Key Vault over the lifetime of a key.

OffsetDateTime getUpdatedOn()

Get the policy's last updated time in UTC.

KeyRotationPolicy setExpiresIn(String expiresIn)

Set the optional key expiration period used to define the duration after which a newly rotated key will expire.

KeyRotationPolicy setLifetimeActions(List<KeyRotationLifetimeAction> lifetimeActions)

Set the actions that will be performed by Key Vault over the lifetime of a key.

Methods inherited from java.lang.Object

Constructor Details

KeyRotationPolicy

public KeyRotationPolicy()

Creates an instance of KeyRotationPolicy.

Method Details

getCreatedOn

public OffsetDateTime getCreatedOn()

Get the policy's created time in UTC.

May be undefined if a policy has not been explicitly set.

Returns:

The policy's created time in UTC.

getExpiresIn

public String getExpiresIn()

Get the optional key expiration period used to define the duration after which a newly rotated key will expire. It should be at least 28 days and should be defined as an ISO 8601 duration. For example, 90 days would be "P90D", 3 months would be "P3M" and 1 year and 10 days would be "P1Y10D". See Wikipedia for more information on ISO 8601 durations.

Returns:

The expiration time in ISO 8601 format.

getId

public String getId()

Get the identifier of the policy.

May be undefined if a policy has not been explicitly set.

Returns:

The identifier of the policy.

getLifetimeActions

public List getLifetimeActions()

Get 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.

Returns:

The KeyRotationLifetimeAction in this policy.

getUpdatedOn

public OffsetDateTime getUpdatedOn()

Get the policy'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.

setExpiresIn

public KeyRotationPolicy setExpiresIn(String expiresIn)

Set the optional key expiration period used to define the duration after which a newly rotated key will expire. It should be at least 28 days and should be defined as an ISO 8601 duration. For example, 90 days would be "P90D", 3 months would be "P3M" and 1 year and 10 days would be "P1Y10D". See Wikipedia for more information on ISO 8601 durations.

Parameters:

expiresIn - The expiration time to set in ISO 8601 duration format.

Returns:

The updated KeyRotationPolicy object.

setLifetimeActions

public KeyRotationPolicy setLifetimeActions(List lifetimeActions)

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.

Parameters:

lifetimeActions - The KeyRotationLifetimeAction to set.

Returns:

The updated KeyRotationPolicy object.

Applies to