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