AWS SDK Version 4 for .NET
API Reference

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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.KeyManagementService.Model.GetKeyLastUsageResponse

Namespace: Amazon.KeyManagementService.Model
Assembly: AWSSDK.KeyManagementService.dll
Version: 3.x.y.z

Syntax

C#
public class GetKeyLastUsageResponse : AmazonWebServiceResponse

The GetKeyLastUsageResponse type exposes the following members

Constructors

NameDescription
Public Method GetKeyLastUsageResponse()

Properties

NameTypeDescription
Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property KeyCreationDate System.Nullable<System.DateTime>

Gets and sets the property KeyCreationDate.

The date and time when the KMS key was created.

Public Property KeyId System.String

Gets and sets the property KeyId.

The globally unique identifier for the KMS key.

Public Property 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.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property 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.

Examples

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.

To retrieve the last usage for a KMS key


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.

            

Version Information

.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