/* * 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.kms; import javax.annotation.Generated; import com.amazonaws.*; import com.amazonaws.regions.*; import com.amazonaws.services.kms.model.*; /** * Interface for accessing KMS. *

* Note: Do not directly implement this interface, new methods are added to it regularly. Extend from * {@link com.amazonaws.services.kms.AbstractAWSKMS} instead. *

*

* Key Management Service *

* Key Management Service (KMS) is an encryption and key management web service. This guide describes the KMS operations * that you can call programmatically. For general information about KMS, see the Key Management Service Developer Guide . *

* *

* KMS has replaced the term customer master key (CMK) with KMS key and KMS key. The concept has * not changed. To prevent breaking changes, KMS is keeping some variations of this term. *

*

* Amazon Web Services provides SDKs that consist of libraries and sample code for various programming languages and * platforms (Java, Ruby, .Net, macOS, Android, etc.). The SDKs provide a convenient way to create programmatic access * to KMS and other Amazon Web Services services. For example, the SDKs take care of tasks such as signing requests (see * below), managing errors, and retrying requests automatically. For more information about the Amazon Web Services * SDKs, including how to download and install them, see Tools for Amazon Web * Services. *

*
*

* We recommend that you use the Amazon Web Services SDKs to make programmatic API calls to KMS. *

*

* If you need to use FIPS 140-2 validated cryptographic modules when communicating with Amazon Web Services, use the * FIPS endpoint in your preferred Amazon Web Services Region. For more information about the available FIPS endpoints, * see Service endpoints in the Key * Management Service topic of the Amazon Web Services General Reference. *

*

* All KMS API calls must be signed and be transmitted using Transport Layer Security (TLS). KMS recommends you always * use the latest supported TLS version. Clients must also support cipher suites with Perfect Forward Secrecy (PFS) such * as Ephemeral Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman (ECDHE). Most modern systems such as * Java 7 and later support these modes. *

*

* Signing Requests *

*

* Requests must be signed using an access key ID and a secret access key. We strongly recommend that you do not use * your Amazon Web Services account root access key ID and secret access key for everyday work. You can use the access * key ID and secret access key for an IAM user or you can use the Security Token Service (STS) to generate temporary * security credentials and use those to sign requests. *

*

* All KMS requests must be signed with Signature Version 4. *

*

* Logging API Requests *

*

* KMS supports CloudTrail, a service that logs Amazon Web Services API calls and related events for your Amazon Web * Services account and delivers them to an Amazon S3 bucket that you specify. By using the information collected by * CloudTrail, you can determine what requests were made to KMS, who made the request, when it was made, and so on. To * learn more about CloudTrail, including how to turn it on and find your log files, see the CloudTrail User Guide. *

*

* Additional Resources *

*

* For more information about credentials and request signing, see the following: *

* *

* Commonly Used API Operations *

*

* Of the API operations discussed in this guide, the following will prove the most useful for most applications. You * will likely perform operations other than these, such as creating keys and assigning policies, by using the console. *

* */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public interface AWSKMS { /** * The region metadata service name for computing region endpoints. You can use this value to retrieve metadata * (such as supported regions) of the service. * * @see RegionUtils#getRegionsForService(String) */ String ENDPOINT_PREFIX = "kms"; /** * Overrides the default endpoint for this client ("https://kms.us-east-1.amazonaws.com/"). Callers can use this * method to control which AWS region they want to work with. *

* Callers can pass in just the endpoint (ex: "kms.us-east-1.amazonaws.com/") or a full URL, including the protocol * (ex: "https://kms.us-east-1.amazonaws.com/"). If the protocol is not specified here, the default protocol from * this client's {@link ClientConfiguration} will be used, which by default is HTTPS. *

* For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available * endpoints for all AWS services, see: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html#region-selection- * choose-endpoint *

* This method is not threadsafe. An endpoint should be configured when the client is created and before any * service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in * transit or retrying. * * @param endpoint * The endpoint (ex: "kms.us-east-1.amazonaws.com/") or a full URL, including the protocol (ex: * "https://kms.us-east-1.amazonaws.com/") of the region specific AWS endpoint this client will communicate * with. * @deprecated use {@link AwsClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)} for * example: * {@code builder.setEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion));} */ @Deprecated void setEndpoint(String endpoint); /** * An alternative to {@link AWSKMS#setEndpoint(String)}, sets the regional endpoint for this client's service calls. * Callers can use this method to control which AWS region they want to work with. *

* By default, all service endpoints in all regions use the https protocol. To use http instead, specify it in the * {@link ClientConfiguration} supplied at construction. *

* This method is not threadsafe. A region should be configured when the client is created and before any service * requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit * or retrying. * * @param region * The region this client will communicate with. See {@link Region#getRegion(com.amazonaws.regions.Regions)} * for accessing a given region. Must not be null and must be a region where the service is available. * * @see Region#getRegion(com.amazonaws.regions.Regions) * @see Region#createClient(Class, com.amazonaws.auth.AWSCredentialsProvider, ClientConfiguration) * @see Region#isServiceSupported(String) * @deprecated use {@link AwsClientBuilder#setRegion(String)} */ @Deprecated void setRegion(Region region); /** *

* Cancels the deletion of a KMS key. When this operation succeeds, the key state of the KMS key is * Disabled. To enable the KMS key, use EnableKey. *

*

* For more information about scheduling and canceling deletion of a KMS key, see Deleting KMS keys in the * Key Management Service Developer Guide. *

*

* The KMS key that you use for this operation must be in a compatible key state. For details, see Key states of KMS keys in the * Key Management Service Developer Guide. *

*

* Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services * account. *

*

* Required permissions: kms:CancelKeyDeletion (key policy) *

*

* Related operations: ScheduleKeyDeletion *

* * @param cancelKeyDeletionRequest * @return Result of the CancelKeyDeletion operation returned by the service. * @throws NotFoundException * The request was rejected because the specified entity or resource could not be found. * @throws InvalidArnException * The request was rejected because a specified ARN, or an ARN in a key policy, is not valid. * @throws DependencyTimeoutException * The system timed out while trying to fulfill the request. You can retry the request. * @throws KMSInternalException * The request was rejected because an internal exception occurred. The request can be retried. * @throws KMSInvalidStateException * The request was rejected because the state of the specified resource is not valid for this request.

*

* This exceptions means one of the following: *

*