blob: 6c9a2546466b893d100d455235beaed0f69bb77b [file] [log] [blame]
Benjamin Wrightb3f887b2018-10-30 13:53:30 -07001/*
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 Gerey3e707812018-11-28 16:47:49 +010014#include "rtc_base/checks.h"
Benjamin Wrightb3f887b2018-10-30 13:53:30 -070015#include "rtc_base/openssl_key_derivation_hkdf.h"
16
17namespace rtc {
18
19KeyDerivation::KeyDerivation() = default;
20KeyDerivation::~KeyDerivation() = default;
21
22// static
23std::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