Shawn Willden | 19fca88 | 2015-01-22 16:35:30 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
Shawn Willden | 95e1382 | 2014-12-15 16:12:16 -0700 | [diff] [blame] | 17 | #include "aes_key.h" |
| 18 | |
Shawn Willden | 907c301 | 2014-12-08 15:51:55 -0700 | [diff] [blame] | 19 | #include <assert.h> |
| 20 | |
Shawn Willden | 19fca88 | 2015-01-22 16:35:30 -0700 | [diff] [blame] | 21 | #include <openssl/err.h> |
| 22 | #include <openssl/rand.h> |
| 23 | |
Shawn Willden | 907c301 | 2014-12-08 15:51:55 -0700 | [diff] [blame] | 24 | #include "aes_operation.h" |
| 25 | #include "unencrypted_key_blob.h" |
Shawn Willden | 19fca88 | 2015-01-22 16:35:30 -0700 | [diff] [blame] | 26 | |
| 27 | namespace keymaster { |
| 28 | |
Shawn Willden | f923963 | 2015-05-12 06:57:37 -0600 | [diff] [blame^] | 29 | Key* AesKeyFactory::LoadKey(const UnencryptedKeyBlob& blob, keymaster_error_t* error) { |
| 30 | return new AesKey(blob, error); |
| 31 | } |
Shawn Willden | a278f61 | 2014-12-23 11:22:21 -0700 | [diff] [blame] | 32 | |
Shawn Willden | f923963 | 2015-05-12 06:57:37 -0600 | [diff] [blame^] | 33 | SymmetricKey* AesKeyFactory::CreateKey(const AuthorizationSet& auths) { |
| 34 | return new AesKey(auths); |
| 35 | } |
Shawn Willden | a278f61 | 2014-12-23 11:22:21 -0700 | [diff] [blame] | 36 | |
Shawn Willden | 19fca88 | 2015-01-22 16:35:30 -0700 | [diff] [blame] | 37 | } // namespace keymaster |