Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 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;
  
  
  
Asynchronous client for accessing AWSKMS. All asynchronous calls made using this client are non-blocking. Callers could either process the result and handle the exceptions in the worker thread by providing a callback handler when making the call, or use the returned Future object to check the result of the call in the calling thread. AWS Key Management Service

AWS Key Management Service (KMS) is an encryption and key management web service. This guide describes the KMS actions that you can call programmatically. For general information about KMS, see (need an address here). For the KMS developer guide, see (need address here).

NOTE: AWS provides SDKs that consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .Net, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to KMS and AWS. 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 AWS SDKs, including how to download and install them, see Tools for Amazon Web Services.

We recommend that you use the AWS SDKs to make programmatic API calls to KMS. However, you can also use the KMS Query API to make to make direct calls to the KMS web service.

Signing Requests

Requests must be signed by using an access key ID and a secret access key. We strongly recommend that you do not use your AWS account access key ID and secret key for everyday work with KMS. Instead, use the access key ID and secret access key for an IAM user, or you can use the AWS Security Token Service to generate temporary security credentials that you can use to sign requests.

All KMS operations require Signature Version 4 .

Recording API Requests

KMS supports AWS CloudTrail, a service that records AWS API calls and related events for your AWS 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 AWS CloudTrail User Guide

Additional Resources

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

  • AWS Security Credentials . This topic provides general information about the types of credentials used for accessing AWS.
  • AWS Security Token Service . This guide describes how to create and use temporary security credentials.
  • Signing AWS API Requests . This set of topics walks you through the process of signing a request using an access key ID and a secret access key.
 
 public class AWSKMSAsyncClient extends AWSKMSClient
         implements AWSKMSAsync {

    
Executor service for executing asynchronous requests.
 
     private ExecutorService executorService;
 
     private static final int DEFAULT_THREAD_POOL_SIZE = 50;

    
Constructs a new asynchronous client to invoke service methods on AWSKMS. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

 
     public AWSKMSAsyncClient() {
         this(new DefaultAWSCredentialsProviderChain());
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS. A credentials provider chain will be used that searches for credentials in this order:
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • Instance profile credentials delivered through the Amazon EC2 metadata service

All service calls made using this new client object are blocking, and will not return until the service call completes.

Parameters:
clientConfiguration The client configuration options controlling how this client connects to AWSKMS (ex: proxy settings, retry counts, etc.).
See also:
com.amazonaws.auth.DefaultAWSCredentialsProviderChain
 
     public AWSKMSAsyncClient(ClientConfiguration clientConfiguration) {
         this(new DefaultAWSCredentialsProviderChain(), clientConfiguration, Executors.newFixedThreadPool(clientConfiguration.getMaxConnections()));
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS using the specified AWS account credentials. Default client settings will be used, and a fixed size thread pool will be created for executing the asynchronous tasks.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
 
     public AWSKMSAsyncClient(AWSCredentials awsCredentials) {
         this(awsCredentials, Executors.newFixedThreadPool());
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS using the specified AWS account credentials and executor service. Default client settings will be used.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
executorService The executor service by which all asynchronous requests will be executed.
 
     public AWSKMSAsyncClient(AWSCredentials awsCredentialsExecutorService executorService) {
         super(awsCredentials);
         this. = executorService;
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS using the specified AWS account credentials, executor service, and client configuration options.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentials The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
clientConfiguration Client configuration options (ex: max retry limit, proxy settings, etc).
executorService The executor service by which all asynchronous requests will be executed.
 
     public AWSKMSAsyncClient(AWSCredentials awsCredentials,
                 ClientConfiguration clientConfigurationExecutorService executorService) {
         super(awsCredentialsclientConfiguration);
         this. = executorService;
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS using the specified AWS account credentials provider. Default client settings will be used, and a fixed size thread pool will be created for executing the asynchronous tasks.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
 
     public AWSKMSAsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
         this(awsCredentialsProvider, Executors.newFixedThreadPool());
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS using the specified AWS account credentials provider and executor service. Default client settings will be used.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
executorService The executor service by which all asynchronous requests will be executed.
 
     public AWSKMSAsyncClient(AWSCredentialsProvider awsCredentialsProviderExecutorService executorService) {
         this(awsCredentialsProvidernew ClientConfiguration(), executorService);
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS using the specified AWS account credentials provider and client configuration options.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration Client configuration options (ex: max retry limit, proxy settings, etc).
 
     public AWSKMSAsyncClient(AWSCredentialsProvider awsCredentialsProvider,
                 ClientConfiguration clientConfiguration) {
         this(awsCredentialsProviderclientConfiguration, Executors.newFixedThreadPool(clientConfiguration.getMaxConnections()));
     }

    
Constructs a new asynchronous client to invoke service methods on AWSKMS using the specified AWS account credentials provider, executor service, and client configuration options.

All calls made using this new client object are non-blocking, and will immediately return a Java Future object that the caller can later check to see if the service call has actually completed.

Parameters:
awsCredentialsProvider The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
clientConfiguration Client configuration options (ex: max retry limit, proxy settings, etc).
executorService The executor service by which all asynchronous requests will be executed.
 
     public AWSKMSAsyncClient(AWSCredentialsProvider awsCredentialsProvider,
                 ClientConfiguration clientConfigurationExecutorService executorService) {
         super(awsCredentialsProviderclientConfiguration);
         this. = executorService;
     }

    
Returns the executor service used by this async client to execute requests.

Returns:
The executor service used by this async client to execute requests.
 
     public ExecutorService getExecutorService() {
         return ;
     }

    
Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should call getExecutorService().shutdown() followed by getExecutorService().awaitTermination() prior to calling this method.
 
     @Override
     public void shutdown() {
         super.shutdown();
         .shutdownNow();
     }
            
    

Creates a customer master key. Customer master keys can be used to encrypt small amounts of data (less than 4K) directly, but they are most commonly used to encrypt or envelope data keys that are then used to encrypt customer data. For more information about data keys, see GenerateDataKey and GenerateDataKeyWithoutPlaintext.

Parameters:
createKeyRequest Container for the necessary parameters to execute the CreateKey operation on AWSKMS.
Returns:
A Java Future object containing the response from the CreateKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<CreateKeyResultcreateKeyAsync(final CreateKeyRequest createKeyRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateKeyResult>() {
             public CreateKeyResult call() throws Exception {
                 return createKey(createKeyRequest);
         }
     });
     }

    

Creates a customer master key. Customer master keys can be used to encrypt small amounts of data (less than 4K) directly, but they are most commonly used to encrypt or envelope data keys that are then used to encrypt customer data. For more information about data keys, see GenerateDataKey and GenerateDataKeyWithoutPlaintext.

Parameters:
createKeyRequest Container for the necessary parameters to execute the CreateKey operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the CreateKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             final CreateKeyRequest createKeyRequest,
             final AsyncHandler<CreateKeyRequestCreateKeyResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateKeyResult>() {
             public CreateKeyResult call() throws Exception {
               CreateKeyResult result;
                 try {
                 result = createKey(createKeyRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(createKeyRequestresult);
                  return result;
         }
     });
     }
    
    

Encrypts plaintext into ciphertext by using a customer master key.

Parameters:
encryptRequest Container for the necessary parameters to execute the Encrypt operation on AWSKMS.
Returns:
A Java Future object containing the response from the Encrypt service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<EncryptResultencryptAsync(final EncryptRequest encryptRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<EncryptResult>() {
             public EncryptResult call() throws Exception {
                 return encrypt(encryptRequest);
         }
     });
     }

    

Encrypts plaintext into ciphertext by using a customer master key.

Parameters:
encryptRequest Container for the necessary parameters to execute the Encrypt operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the Encrypt service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<EncryptResultencryptAsync(
             final EncryptRequest encryptRequest,
             final AsyncHandler<EncryptRequestEncryptResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<EncryptResult>() {
             public EncryptResult call() throws Exception {
               EncryptResult result;
                 try {
                 result = encrypt(encryptRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(encryptRequestresult);
                  return result;
         }
     });
     }
    
    

Retrieves a policy attached to the specified key.

Parameters:
getKeyPolicyRequest Container for the necessary parameters to execute the GetKeyPolicy operation on AWSKMS.
Returns:
A Java Future object containing the response from the GetKeyPolicy service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<GetKeyPolicyResultgetKeyPolicyAsync(final GetKeyPolicyRequest getKeyPolicyRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<GetKeyPolicyResult>() {
             public GetKeyPolicyResult call() throws Exception {
                 return getKeyPolicy(getKeyPolicyRequest);
         }
     });
     }

    

Retrieves a policy attached to the specified key.

Parameters:
getKeyPolicyRequest Container for the necessary parameters to execute the GetKeyPolicy operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the GetKeyPolicy service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             final GetKeyPolicyRequest getKeyPolicyRequest,
             final AsyncHandler<GetKeyPolicyRequestGetKeyPolicyResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<GetKeyPolicyResult>() {
             public GetKeyPolicyResult call() throws Exception {
               GetKeyPolicyResult result;
                 try {
                 result = getKeyPolicy(getKeyPolicyRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(getKeyPolicyRequestresult);
                  return result;
         }
     });
     }
    
    

Updates the description of a key.

Parameters:
updateKeyDescriptionRequest Container for the necessary parameters to execute the UpdateKeyDescription operation on AWSKMS.
Returns:
A Java Future object containing the response from the UpdateKeyDescription service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<VoidupdateKeyDescriptionAsync(final UpdateKeyDescriptionRequest updateKeyDescriptionRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
                 updateKeyDescription(updateKeyDescriptionRequest);
                 return null;
         }
     });
     }

    

Updates the description of a key.

Parameters:
updateKeyDescriptionRequest Container for the necessary parameters to execute the UpdateKeyDescription operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the UpdateKeyDescription service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             final UpdateKeyDescriptionRequest updateKeyDescriptionRequest,
             final AsyncHandler<UpdateKeyDescriptionRequestVoidasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<Void>() {
             public Void call() throws Exception {
               try {
                 updateKeyDescription(updateKeyDescriptionRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(updateKeyDescriptionRequestnull);
                  return null;
         }
     });
     }
    
    

Lists the customer master keys.

Parameters:
listKeysRequest Container for the necessary parameters to execute the ListKeys operation on AWSKMS.
Returns:
A Java Future object containing the response from the ListKeys service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<ListKeysResultlistKeysAsync(final ListKeysRequest listKeysRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<ListKeysResult>() {
             public ListKeysResult call() throws Exception {
                 return listKeys(listKeysRequest);
         }
     });
     }

    

Lists the customer master keys.

Parameters:
listKeysRequest Container for the necessary parameters to execute the ListKeys operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the ListKeys service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             final ListKeysRequest listKeysRequest,
             final AsyncHandler<ListKeysRequestListKeysResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<ListKeysResult>() {
             public ListKeysResult call() throws Exception {
               ListKeysResult result;
                 try {
                 result = listKeys(listKeysRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(listKeysRequestresult);
                  return result;
         }
     });
     }
    
    

Generates a secure data key. Data keys are used to encrypt and decrypt data. They are wrapped by customer master keys.

Parameters:
generateDataKeyRequest Container for the necessary parameters to execute the GenerateDataKey operation on AWSKMS.
Returns:
A Java Future object containing the response from the GenerateDataKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<GenerateDataKeyResultgenerateDataKeyAsync(final GenerateDataKeyRequest generateDataKeyRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<GenerateDataKeyResult>() {
             public GenerateDataKeyResult call() throws Exception {
                 return generateDataKey(generateDataKeyRequest);
         }
     });
     }

    

Generates a secure data key. Data keys are used to encrypt and decrypt data. They are wrapped by customer master keys.

Parameters:
generateDataKeyRequest Container for the necessary parameters to execute the GenerateDataKey operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the GenerateDataKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             final GenerateDataKeyRequest generateDataKeyRequest,
             final AsyncHandler<GenerateDataKeyRequestGenerateDataKeyResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<GenerateDataKeyResult>() {
             public GenerateDataKeyResult call() throws Exception {
               GenerateDataKeyResult result;
                 try {
                 result = generateDataKey(generateDataKeyRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(generateDataKeyRequestresult);
                  return result;
         }
     });
     }
    
    

Adds a grant to a key to specify who can access the key and under what conditions. Grants are alternate permission mechanisms to key policies. If absent, access to the key is evaluated based on IAM policies attached to the user. By default, grants do not expire. Grants can be listed, retired, or revoked as indicated by the following APIs. Typically, when you are finished using a grant, you retire it. When you want to end a grant immediately, revoke it. For more information about grants, see Grants .

  1. ListGrants
  2. RetireGrant
  3. RevokeGrant

Parameters:
createGrantRequest Container for the necessary parameters to execute the CreateGrant operation on AWSKMS.
Returns:
A Java Future object containing the response from the CreateGrant service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<CreateGrantResultcreateGrantAsync(final CreateGrantRequest createGrantRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateGrantResult>() {
             public CreateGrantResult call() throws Exception {
                 return createGrant(createGrantRequest);
         }
     });
     }

    

Adds a grant to a key to specify who can access the key and under what conditions. Grants are alternate permission mechanisms to key policies. If absent, access to the key is evaluated based on IAM policies attached to the user. By default, grants do not expire. Grants can be listed, retired, or revoked as indicated by the following APIs. Typically, when you are finished using a grant, you retire it. When you want to end a grant immediately, revoke it. For more information about grants, see Grants .

  1. ListGrants
  2. RetireGrant
  3. RevokeGrant

Parameters:
createGrantRequest Container for the necessary parameters to execute the CreateGrant operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the CreateGrant service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             final CreateGrantRequest createGrantRequest,
             final AsyncHandler<CreateGrantRequestCreateGrantResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<CreateGrantResult>() {
             public CreateGrantResult call() throws Exception {
               CreateGrantResult result;
                 try {
                 result = createGrant(createGrantRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(createGrantRequestresult);
                  return result;
         }
     });
     }
    
    

Lists all of the key aliases in the account.

Parameters:
listAliasesRequest Container for the necessary parameters to execute the ListAliases operation on AWSKMS.
Returns:
A Java Future object containing the response from the ListAliases service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
     public Future<ListAliasesResultlistAliasesAsync(final ListAliasesRequest listAliasesRequest
             throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<ListAliasesResult>() {
             public ListAliasesResult call() throws Exception {
                 return listAliases(listAliasesRequest);
         }
     });
     }

    

Lists all of the key aliases in the account.

Parameters:
listAliasesRequest Container for the necessary parameters to execute the ListAliases operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the ListAliases service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             final ListAliasesRequest listAliasesRequest,
             final AsyncHandler<ListAliasesRequestListAliasesResultasyncHandler)
                     throws AmazonServiceExceptionAmazonClientException {
         return .submit(new Callable<ListAliasesResult>() {
             public ListAliasesResult call() throws Exception {
               ListAliasesResult result;
                 try {
                 result = listAliases(listAliasesRequest);
               } catch (Exception ex) {
                   asyncHandler.onError(ex);
             throw ex;
               }
               asyncHandler.onSuccess(listAliasesRequestresult);
                  return result;
         }
     });
     }
    
    

Returns a key wrapped by a customer master key without the plaintext copy of that key. To retrieve the plaintext, see GenerateDataKey.

Parameters:
generateDataKeyWithoutPlaintextRequest Container for the necessary parameters to execute the GenerateDataKeyWithoutPlaintext operation on AWSKMS.
Returns:
A Java Future object containing the response from the GenerateDataKeyWithoutPlaintext service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
 
             throws AmazonServiceExceptionAmazonClientException {
             public GenerateDataKeyWithoutPlaintextResult call() throws Exception {
                 return generateDataKeyWithoutPlaintext(generateDataKeyWithoutPlaintextRequest);
         }
     });
     }

    

Returns a key wrapped by a customer master key without the plaintext copy of that key. To retrieve the plaintext, see GenerateDataKey.

Parameters:
generateDataKeyWithoutPlaintextRequest Container for the necessary parameters to execute the GenerateDataKeyWithoutPlaintext operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the GenerateDataKeyWithoutPlaintext service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final GenerateDataKeyWithoutPlaintextRequest generateDataKeyWithoutPlaintextRequest,
                    throws AmazonServiceExceptionAmazonClientException {
            public GenerateDataKeyWithoutPlaintextResult call() throws Exception {
              GenerateDataKeyWithoutPlaintextResult result;
                try {
                result = generateDataKeyWithoutPlaintext(generateDataKeyWithoutPlaintextRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(generateDataKeyWithoutPlaintextRequestresult);
                 return result;
        }
    });
    }
    
    

Deletes the specified alias.

Parameters:
deleteAliasRequest Container for the necessary parameters to execute the DeleteAlias operation on AWSKMS.
Returns:
A Java Future object containing the response from the DeleteAlias service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoiddeleteAliasAsync(final DeleteAliasRequest deleteAliasRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                deleteAlias(deleteAliasRequest);
                return null;
        }
    });
    }

    

Deletes the specified alias.

Parameters:
deleteAliasRequest Container for the necessary parameters to execute the DeleteAlias operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DeleteAlias service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoiddeleteAliasAsync(
            final DeleteAliasRequest deleteAliasRequest,
            final AsyncHandler<DeleteAliasRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                deleteAlias(deleteAliasRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(deleteAliasRequestnull);
                 return null;
        }
    });
    }
    
    

Enables rotation of the specified customer master key.

Parameters:
enableKeyRotationRequest Container for the necessary parameters to execute the EnableKeyRotation operation on AWSKMS.
Returns:
A Java Future object containing the response from the EnableKeyRotation service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidenableKeyRotationAsync(final EnableKeyRotationRequest enableKeyRotationRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                enableKeyRotation(enableKeyRotationRequest);
                return null;
        }
    });
    }

    

Enables rotation of the specified customer master key.

Parameters:
enableKeyRotationRequest Container for the necessary parameters to execute the EnableKeyRotation operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the EnableKeyRotation service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final EnableKeyRotationRequest enableKeyRotationRequest,
            final AsyncHandler<EnableKeyRotationRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                enableKeyRotation(enableKeyRotationRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(enableKeyRotationRequestnull);
                 return null;
        }
    });
    }
    
    

Retires a grant. You can retire a grant when you're done using it to clean up. You should revoke a grant when you intend to actively deny operations that depend on it.

Parameters:
retireGrantRequest Container for the necessary parameters to execute the RetireGrant operation on AWSKMS.
Returns:
A Java Future object containing the response from the RetireGrant service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidretireGrantAsync(final RetireGrantRequest retireGrantRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                retireGrant(retireGrantRequest);
                return null;
        }
    });
    }

    

Retires a grant. You can retire a grant when you're done using it to clean up. You should revoke a grant when you intend to actively deny operations that depend on it.

Parameters:
retireGrantRequest Container for the necessary parameters to execute the RetireGrant operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the RetireGrant service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidretireGrantAsync(
            final RetireGrantRequest retireGrantRequest,
            final AsyncHandler<RetireGrantRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                retireGrant(retireGrantRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(retireGrantRequestnull);
                 return null;
        }
    });
    }
    
    

Provides detailed information about the specified customer master key.

Parameters:
describeKeyRequest Container for the necessary parameters to execute the DescribeKey operation on AWSKMS.
Returns:
A Java Future object containing the response from the DescribeKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<DescribeKeyResultdescribeKeyAsync(final DescribeKeyRequest describeKeyRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<DescribeKeyResult>() {
            public DescribeKeyResult call() throws Exception {
                return describeKey(describeKeyRequest);
        }
    });
    }

    

Provides detailed information about the specified customer master key.

Parameters:
describeKeyRequest Container for the necessary parameters to execute the DescribeKey operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DescribeKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final DescribeKeyRequest describeKeyRequest,
            final AsyncHandler<DescribeKeyRequestDescribeKeyResultasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<DescribeKeyResult>() {
            public DescribeKeyResult call() throws Exception {
              DescribeKeyResult result;
                try {
                result = describeKey(describeKeyRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(describeKeyRequestresult);
                 return result;
        }
    });
    }
    
    

List the grants for a specified key.

Parameters:
listGrantsRequest Container for the necessary parameters to execute the ListGrants operation on AWSKMS.
Returns:
A Java Future object containing the response from the ListGrants service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<ListGrantsResultlistGrantsAsync(final ListGrantsRequest listGrantsRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<ListGrantsResult>() {
            public ListGrantsResult call() throws Exception {
                return listGrants(listGrantsRequest);
        }
    });
    }

    

List the grants for a specified key.

Parameters:
listGrantsRequest Container for the necessary parameters to execute the ListGrants operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the ListGrants service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final ListGrantsRequest listGrantsRequest,
            final AsyncHandler<ListGrantsRequestListGrantsResultasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<ListGrantsResult>() {
            public ListGrantsResult call() throws Exception {
              ListGrantsResult result;
                try {
                result = listGrants(listGrantsRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(listGrantsRequestresult);
                 return result;
        }
    });
    }
    
    

Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted by using the Encrypt function.

Parameters:
decryptRequest Container for the necessary parameters to execute the Decrypt operation on AWSKMS.
Returns:
A Java Future object containing the response from the Decrypt service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<DecryptResultdecryptAsync(final DecryptRequest decryptRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<DecryptResult>() {
            public DecryptResult call() throws Exception {
                return decrypt(decryptRequest);
        }
    });
    }

    

Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted by using the Encrypt function.

Parameters:
decryptRequest Container for the necessary parameters to execute the Decrypt operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the Decrypt service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final DecryptRequest decryptRequest,
            final AsyncHandler<DecryptRequestDecryptResultasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<DecryptResult>() {
            public DecryptResult call() throws Exception {
              DecryptResult result;
                try {
                result = decrypt(decryptRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(decryptRequestresult);
                 return result;
        }
    });
    }
    
    

Generates an unpredictable byte string.

Parameters:
generateRandomRequest Container for the necessary parameters to execute the GenerateRandom operation on AWSKMS.
Returns:
A Java Future object containing the response from the GenerateRandom service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<GenerateRandomResultgenerateRandomAsync(final GenerateRandomRequest generateRandomRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<GenerateRandomResult>() {
            public GenerateRandomResult call() throws Exception {
                return generateRandom(generateRandomRequest);
        }
    });
    }

    

Generates an unpredictable byte string.

Parameters:
generateRandomRequest Container for the necessary parameters to execute the GenerateRandom operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the GenerateRandom service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final GenerateRandomRequest generateRandomRequest,
            final AsyncHandler<GenerateRandomRequestGenerateRandomResultasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<GenerateRandomResult>() {
            public GenerateRandomResult call() throws Exception {
              GenerateRandomResult result;
                try {
                result = generateRandom(generateRandomRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(generateRandomRequestresult);
                 return result;
        }
    });
    }
    
    

Retrieves a Boolean value that indicates whether key rotation is enabled for the specified key.

Parameters:
getKeyRotationStatusRequest Container for the necessary parameters to execute the GetKeyRotationStatus operation on AWSKMS.
Returns:
A Java Future object containing the response from the GetKeyRotationStatus service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<GetKeyRotationStatusResultgetKeyRotationStatusAsync(final GetKeyRotationStatusRequest getKeyRotationStatusRequest
            throws AmazonServiceExceptionAmazonClientException {
            public GetKeyRotationStatusResult call() throws Exception {
                return getKeyRotationStatus(getKeyRotationStatusRequest);
        }
    });
    }

    

Retrieves a Boolean value that indicates whether key rotation is enabled for the specified key.

Parameters:
getKeyRotationStatusRequest Container for the necessary parameters to execute the GetKeyRotationStatus operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the GetKeyRotationStatus service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final GetKeyRotationStatusRequest getKeyRotationStatusRequest,
            final AsyncHandler<GetKeyRotationStatusRequestGetKeyRotationStatusResultasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
            public GetKeyRotationStatusResult call() throws Exception {
              GetKeyRotationStatusResult result;
                try {
                result = getKeyRotationStatus(getKeyRotationStatusRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(getKeyRotationStatusRequestresult);
                 return result;
        }
    });
    }
    
    

Disables rotation of the specified key.

Parameters:
disableKeyRotationRequest Container for the necessary parameters to execute the DisableKeyRotation operation on AWSKMS.
Returns:
A Java Future object containing the response from the DisableKeyRotation service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoiddisableKeyRotationAsync(final DisableKeyRotationRequest disableKeyRotationRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                disableKeyRotation(disableKeyRotationRequest);
                return null;
        }
    });
    }

    

Disables rotation of the specified key.

Parameters:
disableKeyRotationRequest Container for the necessary parameters to execute the DisableKeyRotation operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DisableKeyRotation service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final DisableKeyRotationRequest disableKeyRotationRequest,
            final AsyncHandler<DisableKeyRotationRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                disableKeyRotation(disableKeyRotationRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(disableKeyRotationRequestnull);
                 return null;
        }
    });
    }
    
    

Retrieves a list of policies attached to a key.

Parameters:
listKeyPoliciesRequest Container for the necessary parameters to execute the ListKeyPolicies operation on AWSKMS.
Returns:
A Java Future object containing the response from the ListKeyPolicies service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<ListKeyPoliciesResultlistKeyPoliciesAsync(final ListKeyPoliciesRequest listKeyPoliciesRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<ListKeyPoliciesResult>() {
            public ListKeyPoliciesResult call() throws Exception {
                return listKeyPolicies(listKeyPoliciesRequest);
        }
    });
    }

    

Retrieves a list of policies attached to a key.

Parameters:
listKeyPoliciesRequest Container for the necessary parameters to execute the ListKeyPolicies operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the ListKeyPolicies service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final ListKeyPoliciesRequest listKeyPoliciesRequest,
            final AsyncHandler<ListKeyPoliciesRequestListKeyPoliciesResultasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<ListKeyPoliciesResult>() {
            public ListKeyPoliciesResult call() throws Exception {
              ListKeyPoliciesResult result;
                try {
                result = listKeyPolicies(listKeyPoliciesRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(listKeyPoliciesRequestresult);
                 return result;
        }
    });
    }
    
    

Creates a display name for a customer master key. An alias can be used to identify a key and should be unique. The console enforces a one-to-one mapping between the alias and a key. An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). An alias must start with the word "alias" followed by a forward slash (alias/). An alias that begins with "aws" after the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).

Parameters:
createAliasRequest Container for the necessary parameters to execute the CreateAlias operation on AWSKMS.
Returns:
A Java Future object containing the response from the CreateAlias service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidcreateAliasAsync(final CreateAliasRequest createAliasRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                createAlias(createAliasRequest);
                return null;
        }
    });
    }

    

Creates a display name for a customer master key. An alias can be used to identify a key and should be unique. The console enforces a one-to-one mapping between the alias and a key. An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). An alias must start with the word "alias" followed by a forward slash (alias/). An alias that begins with "aws" after the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).

Parameters:
createAliasRequest Container for the necessary parameters to execute the CreateAlias operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the CreateAlias service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidcreateAliasAsync(
            final CreateAliasRequest createAliasRequest,
            final AsyncHandler<CreateAliasRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                createAlias(createAliasRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(createAliasRequestnull);
                 return null;
        }
    });
    }
    
    

Attaches a policy to the specified key.

Parameters:
putKeyPolicyRequest Container for the necessary parameters to execute the PutKeyPolicy operation on AWSKMS.
Returns:
A Java Future object containing the response from the PutKeyPolicy service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidputKeyPolicyAsync(final PutKeyPolicyRequest putKeyPolicyRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                putKeyPolicy(putKeyPolicyRequest);
                return null;
        }
    });
    }

    

Attaches a policy to the specified key.

Parameters:
putKeyPolicyRequest Container for the necessary parameters to execute the PutKeyPolicy operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the PutKeyPolicy service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidputKeyPolicyAsync(
            final PutKeyPolicyRequest putKeyPolicyRequest,
            final AsyncHandler<PutKeyPolicyRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                putKeyPolicy(putKeyPolicyRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(putKeyPolicyRequestnull);
                 return null;
        }
    });
    }
    
    

Encrypts data on the server side with a new customer master key without exposing the plaintext of the data on the client side. The data is first decrypted and then encrypted. This operation can also be used to change the encryption context of a ciphertext.

Parameters:
reEncryptRequest Container for the necessary parameters to execute the ReEncrypt operation on AWSKMS.
Returns:
A Java Future object containing the response from the ReEncrypt service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<ReEncryptResultreEncryptAsync(final ReEncryptRequest reEncryptRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<ReEncryptResult>() {
            public ReEncryptResult call() throws Exception {
                return reEncrypt(reEncryptRequest);
        }
    });
    }

    

Encrypts data on the server side with a new customer master key without exposing the plaintext of the data on the client side. The data is first decrypted and then encrypted. This operation can also be used to change the encryption context of a ciphertext.

Parameters:
reEncryptRequest Container for the necessary parameters to execute the ReEncrypt operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the ReEncrypt service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
            final ReEncryptRequest reEncryptRequest,
            final AsyncHandler<ReEncryptRequestReEncryptResultasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<ReEncryptResult>() {
            public ReEncryptResult call() throws Exception {
              ReEncryptResult result;
                try {
                result = reEncrypt(reEncryptRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(reEncryptRequestresult);
                 return result;
        }
    });
    }
    
    

Revokes a grant. You can revoke a grant to actively deny operations that depend on it.

Parameters:
revokeGrantRequest Container for the necessary parameters to execute the RevokeGrant operation on AWSKMS.
Returns:
A Java Future object containing the response from the RevokeGrant service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidrevokeGrantAsync(final RevokeGrantRequest revokeGrantRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                revokeGrant(revokeGrantRequest);
                return null;
        }
    });
    }

    

Revokes a grant. You can revoke a grant to actively deny operations that depend on it.

Parameters:
revokeGrantRequest Container for the necessary parameters to execute the RevokeGrant operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the RevokeGrant service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidrevokeGrantAsync(
            final RevokeGrantRequest revokeGrantRequest,
            final AsyncHandler<RevokeGrantRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                revokeGrant(revokeGrantRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(revokeGrantRequestnull);
                 return null;
        }
    });
    }
    
    

Marks a key as enabled, thereby permitting its use. You can have up to 25 enabled keys at one time.

Parameters:
enableKeyRequest Container for the necessary parameters to execute the EnableKey operation on AWSKMS.
Returns:
A Java Future object containing the response from the EnableKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidenableKeyAsync(final EnableKeyRequest enableKeyRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                enableKey(enableKeyRequest);
                return null;
        }
    });
    }

    

Marks a key as enabled, thereby permitting its use. You can have up to 25 enabled keys at one time.

Parameters:
enableKeyRequest Container for the necessary parameters to execute the EnableKey operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the EnableKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoidenableKeyAsync(
            final EnableKeyRequest enableKeyRequest,
            final AsyncHandler<EnableKeyRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                enableKey(enableKeyRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(enableKeyRequestnull);
                 return null;
        }
    });
    }
    
    

Marks a key as disabled, thereby preventing its use.

Parameters:
disableKeyRequest Container for the necessary parameters to execute the DisableKey operation on AWSKMS.
Returns:
A Java Future object containing the response from the DisableKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoiddisableKeyAsync(final DisableKeyRequest disableKeyRequest
            throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
                disableKey(disableKeyRequest);
                return null;
        }
    });
    }

    

Marks a key as disabled, thereby preventing its use.

Parameters:
disableKeyRequest Container for the necessary parameters to execute the DisableKey operation on AWSKMS.
asyncHandler Asynchronous callback handler for events in the life-cycle of the request. Users could provide the implementation of the four callback methods in this interface to process the operation result or handle the exception.
Returns:
A Java Future object containing the response from the DisableKey service method, as returned by AWSKMS.
Throws:
com.amazonaws.AmazonClientException If any internal errors are encountered inside the client while attempting to make the request or handle the response. For example if a network connection is not available.
com.amazonaws.AmazonServiceException If an error response is returned by AWSKMS indicating either a problem with the data in the request, or a server side issue.
    public Future<VoiddisableKeyAsync(
            final DisableKeyRequest disableKeyRequest,
            final AsyncHandler<DisableKeyRequestVoidasyncHandler)
                    throws AmazonServiceExceptionAmazonClientException {
        return .submit(new Callable<Void>() {
            public Void call() throws Exception {
              try {
                disableKey(disableKeyRequest);
              } catch (Exception ex) {
                  asyncHandler.onError(ex);
            throw ex;
              }
              asyncHandler.onSuccess(disableKeyRequestnull);
                 return null;
        }
    });
    }
    
}