/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the kms-2014-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.KeyManagementService.Model
{
///
/// Contains metadata about a KMS key.
///
///
///
/// This data type is used as a response element for the CreateKey, DescribeKey,
/// and ReplicateKey operations.
///
///
public partial class KeyMetadata
{
private string _arn;
private string _awsAccountId;
private string _cloudHsmClusterId;
private DateTime? _creationDate;
private CustomerMasterKeySpec _customerMasterKeySpec;
private string _customKeyStoreId;
private DateTime? _deletionDate;
private string _description;
private bool? _enabled;
private List _encryptionAlgorithms = new List();
private ExpirationModelType _expirationModel;
private string _keyId;
private KeyManagerType _keyManager;
private KeySpec _keySpec;
private KeyState _keyState;
private KeyUsageType _keyUsage;
private List _macAlgorithms = new List();
private bool? _multiRegion;
private MultiRegionConfiguration _multiRegionConfiguration;
private OriginType _origin;
private int? _pendingDeletionWindowInDays;
private List _signingAlgorithms = new List();
private DateTime? _validTo;
private XksKeyConfigurationType _xksKeyConfiguration;
///
/// Gets and sets the property Arn.
///
/// The Amazon Resource Name (ARN) of the KMS key. For examples, see Key
/// Management Service (KMS) in the Example ARNs section of the Amazon Web Services
/// General Reference.
///
///
[AWSProperty(Min=20, Max=2048)]
public string Arn
{
get { return this._arn; }
set { this._arn = value; }
}
// Check to see if Arn property is set
internal bool IsSetArn()
{
return this._arn != null;
}
///
/// Gets and sets the property AWSAccountId.
///
/// The twelve-digit account ID of the Amazon Web Services account that owns the KMS key.
///
///
public string AWSAccountId
{
get { return this._awsAccountId; }
set { this._awsAccountId = value; }
}
// Check to see if AWSAccountId property is set
internal bool IsSetAWSAccountId()
{
return this._awsAccountId != null;
}
///
/// Gets and sets the property CloudHsmClusterId.
///
/// The cluster ID of the CloudHSM cluster that contains the key material for the KMS
/// key. When you create a KMS key in an CloudHSM custom
/// key store, KMS creates the key material for the KMS key in the associated CloudHSM
/// cluster. This field is present only when the KMS key is created in an CloudHSM key
/// store.
///
///
[AWSProperty(Min=19, Max=24)]
public string CloudHsmClusterId
{
get { return this._cloudHsmClusterId; }
set { this._cloudHsmClusterId = value; }
}
// Check to see if CloudHsmClusterId property is set
internal bool IsSetCloudHsmClusterId()
{
return this._cloudHsmClusterId != null;
}
///
/// Gets and sets the property CreationDate.
///
/// The date and time when the KMS key was created.
///
///
public DateTime CreationDate
{
get { return this._creationDate.GetValueOrDefault(); }
set { this._creationDate = value; }
}
// Check to see if CreationDate property is set
internal bool IsSetCreationDate()
{
return this._creationDate.HasValue;
}
///
/// Gets and sets the property CustomerMasterKeySpec.
///
/// Instead, use the KeySpec
field.
///
///
///
/// The KeySpec
and CustomerMasterKeySpec
fields have the same
/// value. We recommend that you use the KeySpec
field in your code. However,
/// to avoid breaking changes, KMS supports both fields.
///
///
[Obsolete("This field has been deprecated. Instead, use the KeySpec field.")]
public CustomerMasterKeySpec CustomerMasterKeySpec
{
get { return this._customerMasterKeySpec; }
set { this._customerMasterKeySpec = value; }
}
// Check to see if CustomerMasterKeySpec property is set
internal bool IsSetCustomerMasterKeySpec()
{
return this._customerMasterKeySpec != null;
}
///
/// Gets and sets the property CustomKeyStoreId.
///
/// A unique identifier for the custom
/// key store that contains the KMS key. This field is present only when the KMS key
/// is created in a custom key store.
///
///
[AWSProperty(Min=1, Max=64)]
public string CustomKeyStoreId
{
get { return this._customKeyStoreId; }
set { this._customKeyStoreId = value; }
}
// Check to see if CustomKeyStoreId property is set
internal bool IsSetCustomKeyStoreId()
{
return this._customKeyStoreId != null;
}
///
/// Gets and sets the property DeletionDate.
///
/// The date and time after which KMS deletes this KMS key. This value is present only
/// when the KMS key is scheduled for deletion, that is, when its KeyState
/// is PendingDeletion
.
///
///
///
/// When the primary key in a multi-Region key is scheduled for deletion but still has
/// replica keys, its key state is PendingReplicaDeletion
and the length
/// of its waiting period is displayed in the PendingDeletionWindowInDays
/// field.
///
///
public DateTime DeletionDate
{
get { return this._deletionDate.GetValueOrDefault(); }
set { this._deletionDate = value; }
}
// Check to see if DeletionDate property is set
internal bool IsSetDeletionDate()
{
return this._deletionDate.HasValue;
}
///
/// Gets and sets the property Description.
///
/// The description of the KMS key.
///
///
[AWSProperty(Min=0, Max=8192)]
public string Description
{
get { return this._description; }
set { this._description = value; }
}
// Check to see if Description property is set
internal bool IsSetDescription()
{
return this._description != null;
}
///
/// Gets and sets the property Enabled.
///
/// Specifies whether the KMS key is enabled. When KeyState
is Enabled
/// this value is true, otherwise it is false.
///
///
public bool Enabled
{
get { return this._enabled.GetValueOrDefault(); }
set { this._enabled = value; }
}
// Check to see if Enabled property is set
internal bool IsSetEnabled()
{
return this._enabled.HasValue;
}
///
/// Gets and sets the property EncryptionAlgorithms.
///
/// The encryption algorithms that the KMS key supports. You cannot use the KMS key with
/// other encryption algorithms within KMS.
///
///
///
/// This value is present only when the KeyUsage
of the KMS key is ENCRYPT_DECRYPT
.
///
///
public List EncryptionAlgorithms
{
get { return this._encryptionAlgorithms; }
set { this._encryptionAlgorithms = value; }
}
// Check to see if EncryptionAlgorithms property is set
internal bool IsSetEncryptionAlgorithms()
{
return this._encryptionAlgorithms != null && this._encryptionAlgorithms.Count > 0;
}
///
/// Gets and sets the property ExpirationModel.
///
/// Specifies whether the KMS key's key material expires. This value is present only when
/// Origin
is EXTERNAL
, otherwise this value is omitted.
///
///
public ExpirationModelType ExpirationModel
{
get { return this._expirationModel; }
set { this._expirationModel = value; }
}
// Check to see if ExpirationModel property is set
internal bool IsSetExpirationModel()
{
return this._expirationModel != null;
}
///
/// Gets and sets the property KeyId.
///
/// The globally unique identifier for the KMS key.
///
///
[AWSProperty(Required=true, Min=1, Max=2048)]
public string KeyId
{
get { return this._keyId; }
set { this._keyId = value; }
}
// Check to see if KeyId property is set
internal bool IsSetKeyId()
{
return this._keyId != null;
}
///
/// Gets and sets the property KeyManager.
///
/// The manager of the KMS key. KMS keys in your Amazon Web Services account are either
/// customer managed or Amazon Web Services managed. For more information about the difference,
/// see KMS
/// keys in the Key Management Service Developer Guide.
///
///
public KeyManagerType KeyManager
{
get { return this._keyManager; }
set { this._keyManager = value; }
}
// Check to see if KeyManager property is set
internal bool IsSetKeyManager()
{
return this._keyManager != null;
}
///
/// Gets and sets the property KeySpec.
///
/// Describes the type of key material in the KMS key.
///
///
public KeySpec KeySpec
{
get { return this._keySpec; }
set { this._keySpec = value; }
}
// Check to see if KeySpec property is set
internal bool IsSetKeySpec()
{
return this._keySpec != null;
}
///
/// Gets and sets the property KeyState.
///
/// The current status of the KMS key.
///
///
///
/// For more information about how key state affects the use of a KMS key, see Key
/// states of KMS keys in the Key Management Service Developer Guide.
///
///
public KeyState KeyState
{
get { return this._keyState; }
set { this._keyState = value; }
}
// Check to see if KeyState property is set
internal bool IsSetKeyState()
{
return this._keyState != null;
}
///
/// Gets and sets the property KeyUsage.
///
/// The cryptographic
/// operations for which you can use the KMS key.
///
///
public KeyUsageType KeyUsage
{
get { return this._keyUsage; }
set { this._keyUsage = value; }
}
// Check to see if KeyUsage property is set
internal bool IsSetKeyUsage()
{
return this._keyUsage != null;
}
///
/// Gets and sets the property MacAlgorithms.
///
/// The message authentication code (MAC) algorithm that the HMAC KMS key supports.
///
///
///
/// This value is present only when the KeyUsage
of the KMS key is GENERATE_VERIFY_MAC
.
///
///
public List MacAlgorithms
{
get { return this._macAlgorithms; }
set { this._macAlgorithms = value; }
}
// Check to see if MacAlgorithms property is set
internal bool IsSetMacAlgorithms()
{
return this._macAlgorithms != null && this._macAlgorithms.Count > 0;
}
///
/// Gets and sets the property MultiRegion.
///
/// Indicates whether the KMS key is a multi-Region (True
) or regional (False
)
/// key. This value is True
for multi-Region primary and replica keys and
/// False
for regional KMS keys.
///
///
///
/// For more information about multi-Region keys, see Multi-Region
/// keys in KMS in the Key Management Service Developer Guide.
///
///
public bool MultiRegion
{
get { return this._multiRegion.GetValueOrDefault(); }
set { this._multiRegion = value; }
}
// Check to see if MultiRegion property is set
internal bool IsSetMultiRegion()
{
return this._multiRegion.HasValue;
}
///
/// Gets and sets the property MultiRegionConfiguration.
///
/// Lists the primary and replica keys in same multi-Region key. This field is present
/// only when the value of the MultiRegion
field is True
.
///
///
///
/// For more information about any listed KMS key, use the DescribeKey operation.
///
/// -
///
///
MultiRegionKeyType
indicates whether the KMS key is a PRIMARY
/// or REPLICA
key.
///
/// -
///
///
PrimaryKey
displays the key ARN and Region of the primary key. This
/// field displays the current KMS key if it is the primary key.
///
/// -
///
///
ReplicaKeys
displays the key ARNs and Regions of all replica keys. This
/// field includes the current KMS key if it is a replica key.
///
///
///
public MultiRegionConfiguration MultiRegionConfiguration
{
get { return this._multiRegionConfiguration; }
set { this._multiRegionConfiguration = value; }
}
// Check to see if MultiRegionConfiguration property is set
internal bool IsSetMultiRegionConfiguration()
{
return this._multiRegionConfiguration != null;
}
///
/// Gets and sets the property Origin.
///
/// The source of the key material for the KMS key. When this value is AWS_KMS
,
/// KMS created the key material. When this value is EXTERNAL
, the key material
/// was imported or the KMS key doesn't have any key material. When this value is AWS_CLOUDHSM
,
/// the key material was created in the CloudHSM cluster associated with a custom key
/// store.
///
///
public OriginType Origin
{
get { return this._origin; }
set { this._origin = value; }
}
// Check to see if Origin property is set
internal bool IsSetOrigin()
{
return this._origin != null;
}
///
/// Gets and sets the property PendingDeletionWindowInDays.
///
/// The waiting period before the primary key in a multi-Region key is deleted. This waiting
/// period begins when the last of its replica keys is deleted. This value is present
/// only when the KeyState
of the KMS key is PendingReplicaDeletion
.
/// That indicates that the KMS key is the primary key in a multi-Region key, it is scheduled
/// for deletion, and it still has existing replica keys.
///
///
///
/// When a single-Region KMS key or a multi-Region replica key is scheduled for deletion,
/// its deletion date is displayed in the DeletionDate
field. However, when
/// the primary key in a multi-Region key is scheduled for deletion, its waiting period
/// doesn't begin until all of its replica keys are deleted. This value displays that
/// waiting period. When the last replica key in the multi-Region key is deleted, the
/// KeyState
of the scheduled primary key changes from PendingReplicaDeletion
/// to PendingDeletion
and the deletion date appears in the DeletionDate
/// field.
///
///
[AWSProperty(Min=1, Max=365)]
public int PendingDeletionWindowInDays
{
get { return this._pendingDeletionWindowInDays.GetValueOrDefault(); }
set { this._pendingDeletionWindowInDays = value; }
}
// Check to see if PendingDeletionWindowInDays property is set
internal bool IsSetPendingDeletionWindowInDays()
{
return this._pendingDeletionWindowInDays.HasValue;
}
///
/// Gets and sets the property SigningAlgorithms.
///
/// The signing algorithms that the KMS key supports. You cannot use the KMS key with
/// other signing algorithms within KMS.
///
///
///
/// This field appears only when the KeyUsage
of the KMS key is SIGN_VERIFY
.
///
///
public List SigningAlgorithms
{
get { return this._signingAlgorithms; }
set { this._signingAlgorithms = value; }
}
// Check to see if SigningAlgorithms property is set
internal bool IsSetSigningAlgorithms()
{
return this._signingAlgorithms != null && this._signingAlgorithms.Count > 0;
}
///
/// Gets and sets the property ValidTo.
///
/// The time at which the imported key material expires. When the key material expires,
/// KMS deletes the key material and the KMS key becomes unusable. This value is present
/// only for KMS keys whose Origin
is EXTERNAL
and whose ExpirationModel
/// is KEY_MATERIAL_EXPIRES
, otherwise this value is omitted.
///
///
public DateTime ValidTo
{
get { return this._validTo.GetValueOrDefault(); }
set { this._validTo = value; }
}
// Check to see if ValidTo property is set
internal bool IsSetValidTo()
{
return this._validTo.HasValue;
}
///
/// Gets and sets the property XksKeyConfiguration.
///
/// Information about the external key that is associated with a KMS key in an external
/// key store.
///
///
///
/// For more information, see External
/// key in the Key Management Service Developer Guide.
///
///
public XksKeyConfigurationType XksKeyConfiguration
{
get { return this._xksKeyConfiguration; }
set { this._xksKeyConfiguration = value; }
}
// Check to see if XksKeyConfiguration property is set
internal bool IsSetXksKeyConfiguration()
{
return this._xksKeyConfiguration != null;
}
}
}