Benjamin Wright | b3f887b | 2018-10-30 13:53:30 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "rtc_base/key_derivation.h" |
| 12 | |
| 13 | #include "absl/memory/memory.h" |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 14 | #include "rtc_base/checks.h" |
Benjamin Wright | b3f887b | 2018-10-30 13:53:30 -0700 | [diff] [blame] | 15 | #include "rtc_base/openssl_key_derivation_hkdf.h" |
| 16 | |
| 17 | namespace rtc { |
| 18 | |
| 19 | KeyDerivation::KeyDerivation() = default; |
| 20 | KeyDerivation::~KeyDerivation() = default; |
| 21 | |
| 22 | // static |
| 23 | std::unique_ptr<KeyDerivation> KeyDerivation::Create( |
| 24 | KeyDerivationAlgorithm key_derivation_algorithm) { |
| 25 | switch (key_derivation_algorithm) { |
| 26 | case KeyDerivationAlgorithm::HKDF_SHA256: |
| 27 | return absl::make_unique<OpenSSLKeyDerivationHKDF>(); |
| 28 | } |
| 29 | RTC_NOTREACHED(); |
| 30 | } |
| 31 | |
| 32 | } // namespace rtc |