/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Utils; namespace Aws { namespace KMS { namespace Model { namespace KeyEncryptionMechanismMapper { static const int RSAES_OAEP_SHA_256_HASH = HashingUtils::HashString("RSAES_OAEP_SHA_256"); KeyEncryptionMechanism GetKeyEncryptionMechanismForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == RSAES_OAEP_SHA_256_HASH) { return KeyEncryptionMechanism::RSAES_OAEP_SHA_256; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return KeyEncryptionMechanism::NOT_SET; } Aws::String GetNameForKeyEncryptionMechanism(KeyEncryptionMechanism enumValue) { switch(enumValue) { case KeyEncryptionMechanism::RSAES_OAEP_SHA_256: return "RSAES_OAEP_SHA_256"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace KeyEncryptionMechanismMapper } // namespace Model } // namespace KMS } // namespace Aws