blob: 294832dcae998e7ce07177e9f1dae0d35b2b278c [file] [log] [blame]
Shawn Willden0d560bf2014-12-15 17:44:02 -07001/*
2 * Copyright 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "hmac_key.h"
18
19#include <openssl/err.h>
20#include <openssl/rand.h>
21
22#include "hmac_operation.h"
23
24namespace keymaster {
25
Shawn Willden13fbe3e2015-05-23 03:36:30 +000026Key* HmacKeyFactory::LoadKey(const UnencryptedKeyBlob& blob, keymaster_error_t* error) {
27 return new HmacKey(blob, error);
28}
Shawn Willdena278f612014-12-23 11:22:21 -070029
Shawn Willden13fbe3e2015-05-23 03:36:30 +000030SymmetricKey* HmacKeyFactory::CreateKey(const AuthorizationSet& auths) {
31 return new HmacKey(auths);
Shawn Willdenf9239632015-05-12 06:57:37 -060032}
Shawn Willdena278f612014-12-23 11:22:21 -070033
Shawn Willden0d560bf2014-12-15 17:44:02 -070034} // namespace keymaster