/* * 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 org.w3c.dom.*; import java.net.*; import java.util.*; import javax.annotation.Generated; import org.apache.commons.logging.*; import com.amazonaws.*; import com.amazonaws.annotation.SdkInternalApi; import com.amazonaws.auth.*; import com.amazonaws.handlers.*; import com.amazonaws.http.*; import com.amazonaws.internal.*; import com.amazonaws.internal.auth.*; import com.amazonaws.metrics.*; import com.amazonaws.regions.*; import com.amazonaws.transform.*; import com.amazonaws.util.*; import com.amazonaws.protocol.json.*; import com.amazonaws.util.AWSRequestMetrics.Field; import com.amazonaws.annotation.ThreadSafe; import com.amazonaws.client.AwsSyncClientParams; import com.amazonaws.client.builder.AdvancedConfig; import com.amazonaws.services.kms.AWSKMSClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.kms.model.*; import com.amazonaws.services.kms.model.transform.*; /** * Client for accessing KMS. All service calls made using this client are blocking, and will not return until the * service call completes. *

* 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. *

* */ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSKMSClient extends AmazonWebServiceClient implements AWSKMS { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AWSKMS.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "kms"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CloudHsmClusterNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CloudHsmClusterNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyInvalidConfigurationException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyInvalidConfigurationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ExpiredImportTokenException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.ExpiredImportTokenExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CustomKeyStoreNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CustomKeyStoreNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyVpcEndpointServiceInvalidConfigurationException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyVpcEndpointServiceInvalidConfigurationExceptionUnmarshaller .getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("KMSInvalidMacException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.KMSInvalidMacExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyIncorrectAuthenticationCredentialException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyIncorrectAuthenticationCredentialExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("MalformedPolicyDocumentException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.MalformedPolicyDocumentExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyUriUnreachableException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyUriUnreachableExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("IncorrectKeyMaterialException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.IncorrectKeyMaterialExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidImportTokenException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidImportTokenExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyUriInUseException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyUriInUseExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidArnException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidArnExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("KMSInvalidSignatureException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.KMSInvalidSignatureExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("KMSInvalidStateException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.KMSInvalidStateExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CloudHsmClusterNotRelatedException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CloudHsmClusterNotRelatedExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CustomKeyStoreInvalidStateException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CustomKeyStoreInvalidStateExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("IncorrectTrustAnchorException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.IncorrectTrustAnchorExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("DisabledException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.DisabledExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("NotFoundException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.NotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CustomKeyStoreHasCMKsException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CustomKeyStoreHasCMKsExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("KeyUnavailableException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.KeyUnavailableExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.LimitExceededExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CloudHsmClusterInUseException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CloudHsmClusterInUseExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidCiphertextException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidCiphertextExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyInvalidResponseException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyInvalidResponseExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidGrantIdException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidGrantIdExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyUriEndpointInUseException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyUriEndpointInUseExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("IncorrectKeyException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.IncorrectKeyExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidGrantTokenException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidGrantTokenExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksKeyInvalidConfigurationException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksKeyInvalidConfigurationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("UnsupportedOperationException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.UnsupportedOperationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CustomKeyStoreNameInUseException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CustomKeyStoreNameInUseExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AlreadyExistsException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.AlreadyExistsExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("TagException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.TagExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksKeyAlreadyInUseException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksKeyAlreadyInUseExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidKeyUsageException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidKeyUsageExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyVpcEndpointServiceInUseException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyVpcEndpointServiceInUseExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CloudHsmClusterInvalidConfigurationException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CloudHsmClusterInvalidConfigurationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidMarkerException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidMarkerExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidAliasNameException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.InvalidAliasNameExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksKeyNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksKeyNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("XksProxyVpcEndpointServiceNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.XksProxyVpcEndpointServiceNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("DependencyTimeoutException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.DependencyTimeoutExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("KMSInternalException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.KMSInternalExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("CloudHsmClusterNotActiveException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.CloudHsmClusterNotActiveExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("DryRunOperationException").withExceptionUnmarshaller( com.amazonaws.services.kms.model.transform.DryRunOperationExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass(com.amazonaws.services.kms.model.AWSKMSException.class)); /** * Constructs a new client to invoke service methods on KMS. A credentials provider chain will be used that searches * for credentials in this order: * * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @see DefaultAWSCredentialsProviderChain * @deprecated use {@link AWSKMSClientBuilder#defaultClient()} */ @Deprecated public AWSKMSClient() { this(DefaultAWSCredentialsProviderChain.getInstance(), configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on KMS. A credentials provider chain will be used that searches * for credentials in this order: *

* *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientConfiguration * The client configuration options controlling how this client connects to KMS (ex: proxy settings, retry * counts, etc.). * * @see DefaultAWSCredentialsProviderChain * @deprecated use {@link AWSKMSClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSKMSClient(ClientConfiguration clientConfiguration) { this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration); } /** * Constructs a new client to invoke service methods on KMS using the specified AWS account credentials. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @deprecated use {@link AWSKMSClientBuilder#withCredentials(AWSCredentialsProvider)} for example: * {@code AWSKMSClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();} */ @Deprecated public AWSKMSClient(AWSCredentials awsCredentials) { this(awsCredentials, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on KMS using the specified AWS account credentials and client * configuration options. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to KMS (ex: proxy settings, retry * counts, etc.). * @deprecated use {@link AWSKMSClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSKMSClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSKMSClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) { super(clientConfiguration); this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials); this.advancedConfig = AdvancedConfig.EMPTY; init(); } /** * Constructs a new client to invoke service methods on KMS using the specified AWS account credentials provider. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @deprecated use {@link AWSKMSClientBuilder#withCredentials(AWSCredentialsProvider)} */ @Deprecated public AWSKMSClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, configFactory.getConfig()); } /** * Constructs a new client to invoke service methods on KMS using the specified AWS account credentials provider and * client configuration options. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to KMS (ex: proxy settings, retry * counts, etc.). * @deprecated use {@link AWSKMSClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSKMSClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSKMSClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, null); } /** * Constructs a new client to invoke service methods on KMS using the specified AWS account credentials provider, * client configuration options, and request metric collector. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * The client configuration options controlling how this client connects to KMS (ex: proxy settings, retry * counts, etc.). * @param requestMetricCollector * optional request metric collector * @deprecated use {@link AWSKMSClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSKMSClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AWSKMSClientBuilder#withMetricsCollector(RequestMetricCollector)} */ @Deprecated public AWSKMSClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, RequestMetricCollector requestMetricCollector) { super(clientConfiguration, requestMetricCollector); this.awsCredentialsProvider = awsCredentialsProvider; this.advancedConfig = AdvancedConfig.EMPTY; init(); } public static AWSKMSClientBuilder builder() { return AWSKMSClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on KMS using the specified parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSKMSClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on KMS using the specified parameters. * *

* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AWSKMSClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("https://kms.us-east-1.amazonaws.com/"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/kms/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/kms/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *

* 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: *

*