AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
This is the response object from the GetKeyLastUsage operation.
Namespace: Amazon.KeyManagementService.Model
Assembly: AWSSDK.KeyManagementService.dll
Version: 3.x.y.z
public class GetKeyLastUsageResponse : AmazonWebServiceResponse
The GetKeyLastUsageResponse type exposes the following members
| Name | Description | |
|---|---|---|
|
GetKeyLastUsageResponse() |
| Name | Type | Description | |
|---|---|---|---|
|
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
KeyCreationDate | System.Nullable<System.DateTime> |
Gets and sets the property KeyCreationDate. The date and time when the KMS key was created. |
|
KeyId | System.String |
Gets and sets the property KeyId. The globally unique identifier for the KMS key. |
|
KeyLastUsage | Amazon.KeyManagementService.Model.KeyLastUsageData |
Gets and sets the property KeyLastUsage. Contains usage information about the last time the KMS key was used for a successful cryptographic operation. If the key has not been used since tracking began, this response element is empty. |
|
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
|
TrackingStartDate | System.Nullable<System.DateTime> |
Gets and sets the property TrackingStartDate. The date from which KMS began recording cryptographic activity for this key, or the date the KMS key was created, whichever is later. |
The following example retrieves usage information about the last successful cryptographic operation performed with the specified KMS key, including the operation type, timestamp, and associated AWS CloudTrail event ID.
var client = new AmazonKeyManagementServiceClient();
var response = client.GetKeyLastUsage(new GetKeyLastUsageRequest
{
KeyId = "1234abcd-12ab-34cd-56ef-1234567890ab" // The identifier of the KMS key to get usage information for. You can use the key ID or the Amazon Resource Name (ARN) of the KMS key. Alias names are not supported.
});
DateTime keyCreationDate = response.KeyCreationDate; // The date and time when the KMS key was created.
string keyId = response.KeyId; // The globally unique identifier for the KMS key.
KeyLastUsageData keyLastUsage = response.KeyLastUsage; // Contains usage information about the last time the KMS key was used for a successful cryptographic operation.
DateTime trackingStartDate = response.TrackingStartDate; // The date from which AWS KMS began recording cryptographic activity for this key, or the date the KMS key was created, whichever is later.
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.7.2 and newer