| 78 | } |
| 79 | |
| 80 | std::string LocalWrapKmsClient::WrapKey(const SecureString& key_bytes, |
| 81 | const std::string& master_key_identifier) { |
| 82 | const auto master_key = master_key_cache_.GetOrInsert( |
| 83 | master_key_identifier, [this, master_key_identifier]() -> SecureString { |
| 84 | return this->GetKeyFromServer(master_key_identifier); |
| 85 | }); |
| 86 | const auto& aad = master_key_identifier; |
| 87 | |
| 88 | const auto encrypted_encoded_key = |
| 89 | internal::EncryptKeyLocally(key_bytes, master_key, aad); |
| 90 | return LocalKeyWrap::CreateSerialized(encrypted_encoded_key); |
| 91 | } |
| 92 | |
| 93 | SecureString LocalWrapKmsClient::UnwrapKey(const std::string& wrapped_key, |
| 94 | const std::string& master_key_identifier) { |
nothing calls this directly
no test coverage detected