in src/Internal/SetupDecryptionHandler.cs [226:256]
protected override void InvokeAsyncCallback(IAsyncExecutionContext executionContext)
{
IExecutionContext syncExecutionContext = ExecutionContext.CreateFromAsyncContext(executionContext);
// Process the response if an exception hasn't occured
if (executionContext.ResponseContext.AsyncResult.Exception == null)
{
byte[] encryptedKMSEnvelopeKey;
Dictionary<string, string> encryptionContext;
if (KMSEnvelopeKeyIsPresent(syncExecutionContext, out encryptedKMSEnvelopeKey, out encryptionContext))
throw new NotSupportedException("The AWS SDK for .NET Framework 3.5 version of " +
EncryptionClient.GetType().Name + " does not support KMS key wrapping via the async programming model. " +
"Please use the synchronous version instead.");
var getObjectResponse = executionContext.ResponseContext.Response as GetObjectResponse;
if (getObjectResponse != null)
{
DecryptObject(encryptedKMSEnvelopeKey, getObjectResponse);
}
var completeMultiPartUploadRequest = executionContext.RequestContext.Request.OriginalRequest as CompleteMultipartUploadRequest;
var completeMultipartUploadResponse = executionContext.ResponseContext.Response as CompleteMultipartUploadResponse;
if (completeMultipartUploadResponse != null)
{
CompleteMultipartUpload(completeMultiPartUploadRequest);
}
PostInvokeSynchronous(syncExecutionContext, null);
}
base.InvokeAsyncCallback(executionContext);
}