/* * Copyright 2018-2023 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. */ package com.amazonaws.services.paymentcryptography.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateKeyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the * key not enabled, then it is created but not activated. The default value is enabled. *
*/ private Boolean enabled; /** ** Specifies whether the key is exportable from the service. *
*/ private Boolean exportable; /** ** The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data * is immutable after the key is created. *
*/ private KeyAttributes keyAttributes; /** ** The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES * and AES keys. *
** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and * retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 * bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted * result. *
*/ private String keyCheckValueAlgorithm; /** ** The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value * are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web * Services Payment Cryptography key with the same tag key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key. *
** Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the * key not enabled, then it is created but not activated. The default value is enabled. *
* * @param enabled * Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If * the key not enabled, then it is created but not activated. The default value is enabled. */ public void setEnabled(Boolean enabled) { this.enabled = enabled; } /** ** Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the * key not enabled, then it is created but not activated. The default value is enabled. *
* * @return Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. * If the key not enabled, then it is created but not activated. The default value is enabled. */ public Boolean getEnabled() { return this.enabled; } /** ** Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the * key not enabled, then it is created but not activated. The default value is enabled. *
* * @param enabled * Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If * the key not enabled, then it is created but not activated. The default value is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateKeyRequest withEnabled(Boolean enabled) { setEnabled(enabled); return this; } /** ** Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. If the * key not enabled, then it is created but not activated. The default value is enabled. *
* * @return Specifies whether to enable the key. If the key is enabled, it is activated for use within the service. * If the key not enabled, then it is created but not activated. The default value is enabled. */ public Boolean isEnabled() { return this.enabled; } /** ** Specifies whether the key is exportable from the service. *
* * @param exportable * Specifies whether the key is exportable from the service. */ public void setExportable(Boolean exportable) { this.exportable = exportable; } /** ** Specifies whether the key is exportable from the service. *
* * @return Specifies whether the key is exportable from the service. */ public Boolean getExportable() { return this.exportable; } /** ** Specifies whether the key is exportable from the service. *
* * @param exportable * Specifies whether the key is exportable from the service. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateKeyRequest withExportable(Boolean exportable) { setExportable(exportable); return this; } /** ** Specifies whether the key is exportable from the service. *
* * @return Specifies whether the key is exportable from the service. */ public Boolean isExportable() { return this.exportable; } /** ** The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data * is immutable after the key is created. *
* * @param keyAttributes * The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. * This data is immutable after the key is created. */ public void setKeyAttributes(KeyAttributes keyAttributes) { this.keyAttributes = keyAttributes; } /** ** The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data * is immutable after the key is created. *
* * @return The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. * This data is immutable after the key is created. */ public KeyAttributes getKeyAttributes() { return this.keyAttributes; } /** ** The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data * is immutable after the key is created. *
* * @param keyAttributes * The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. * This data is immutable after the key is created. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateKeyRequest withKeyAttributes(KeyAttributes keyAttributes) { setKeyAttributes(keyAttributes); return this; } /** ** The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES * and AES keys. *
** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and * retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 * bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted * result. *
* * @param keyCheckValueAlgorithm * The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) * for DES and AES keys. ** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked * and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by * encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order * bytes of the encrypted result. * @see KeyCheckValueAlgorithm */ public void setKeyCheckValueAlgorithm(String keyCheckValueAlgorithm) { this.keyCheckValueAlgorithm = keyCheckValueAlgorithm; } /** *
* The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES * and AES keys. *
** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and * retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 * bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted * result. *
* * @return The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) * for DES and AES keys. ** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked * and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by * encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order * bytes of the encrypted result. * @see KeyCheckValueAlgorithm */ public String getKeyCheckValueAlgorithm() { return this.keyCheckValueAlgorithm; } /** *
* The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES * and AES keys. *
** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and * retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 * bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted * result. *
* * @param keyCheckValueAlgorithm * The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) * for DES and AES keys. ** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked * and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by * encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order * bytes of the encrypted result. * @return Returns a reference to this object so that method calls can be chained together. * @see KeyCheckValueAlgorithm */ public CreateKeyRequest withKeyCheckValueAlgorithm(String keyCheckValueAlgorithm) { setKeyCheckValueAlgorithm(keyCheckValueAlgorithm); return this; } /** *
* The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) for DES * and AES keys. *
** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked and * retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by encrypting 8 * bytes, each with value '01', with the key to be checked and retaining the 3 highest order bytes of the encrypted * result. *
* * @param keyCheckValueAlgorithm * The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV) * for DES and AES keys. ** For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', with the key to be checked * and retaining the 3 highest order bytes of the encrypted result. For AES key, the KCV is computed by * encrypting 8 bytes, each with value '01', with the key to be checked and retaining the 3 highest order * bytes of the encrypted result. * @return Returns a reference to this object so that method calls can be chained together. * @see KeyCheckValueAlgorithm */ public CreateKeyRequest withKeyCheckValueAlgorithm(KeyCheckValueAlgorithm keyCheckValueAlgorithm) { this.keyCheckValueAlgorithm = keyCheckValueAlgorithm.toString(); return this; } /** *
* The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value * are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web * Services Payment Cryptography key with the same tag key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in * plaintext in CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the * key. *
*/ public java.util.List* The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value * are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web * Services Payment Cryptography key with the same tag key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in * plaintext in CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the * key. *
*/ public void setTags(java.util.Collection* The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value * are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web * Services Payment Cryptography key with the same tag key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the * tag value are required, but the tag value can be an empty (null) string. You can't have more than one tag * on an Amazon Web Services Payment Cryptography key with the same tag key. *
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in * plaintext in CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the * key. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateKeyRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList* The tags to attach to the key. Each tag consists of a tag key and a tag value. Both the tag key and the tag value * are required, but the tag value can be an empty (null) string. You can't have more than one tag on an Amazon Web * Services Payment Cryptography key with the same tag key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in plaintext in * CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the key. *
*
* To use this parameter, you must have TagResource
permission.
*
* Don't include confidential or sensitive information in this field. This field may be displayed in * plaintext in CloudTrail logs and other output. *
** Tagging or untagging an Amazon Web Services Payment Cryptography key can allow or deny permission to the * key. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateKeyRequest withTags(java.util.Collection