/* * Copyright 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. */ using System; using System.Collections.Generic; using System.Net; namespace Amazon.Runtime.SharedInterfaces { /// /// ICoreAmazonKMS is not meant to be used directly. It defines Key Management Service /// with basic .NET types and allows other services to be able to use the service as /// a runtime dependency. This interface is implemented by the AmazonKeyManagementServiceClient /// defined in the AWSSDK.KeyManagementService assembly. /// public interface ICoreAmazonKMS : IDisposable { GenerateDataKeyResult GenerateDataKey(string keyID, Dictionary encryptionContext, string keySpec); byte[] Decrypt(byte[] ciphertextBlob, Dictionary encryptionContext); #if AWS_ASYNC_API System.Threading.Tasks.Task GenerateDataKeyAsync(string keyID, Dictionary encryptionContext, string keySpec); System.Threading.Tasks.Task DecryptAsync(byte[] ciphertextBlob, Dictionary encryptionContext); #endif } /// /// The result of the GenerateDataKey and GenerateDataKeyAsync operations. /// public class GenerateDataKeyResult { /// /// The plaintext for the data key. /// public byte[] KeyPlaintext { get; set; } /// /// The ciphertext for the data key. /// public byte[] KeyCiphertext { get; set; } } }