Adam Langley | 1fb0583 | 2014-09-23 17:42:36 -0700 | [diff] [blame] | 1 | /* Copyright 2014 The Android Open Source Project |
| 2 | * |
| 3 | * Redistribution and use in source and binary forms, with or without |
| 4 | * modification, are permitted provided that the following conditions |
| 5 | * are met: |
| 6 | * 1. Redistributions of source code must retain the above copyright |
| 7 | * notice, this list of conditions and the following disclaimer. |
| 8 | * 2. Redistributions in binary form must reproduce the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer in the |
| 10 | * documentation and/or other materials provided with the distribution. |
| 11 | * |
| 12 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY |
| 13 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 15 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY |
| 16 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 17 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 18 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 20 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 21 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
| 22 | |
Janis Danisevskis | c7a9fa2 | 2016-10-13 18:43:45 +0100 | [diff] [blame] | 23 | #define LOG_TAG "keystore-engine" |
Adam Langley | 1fb0583 | 2014-09-23 17:42:36 -0700 | [diff] [blame] | 24 | |
Logan Chien | cdc813f | 2018-04-23 13:52:28 +0800 | [diff] [blame] | 25 | #include <log/log.h> |
Paul Stewart | ac0ffbf | 2017-03-03 16:43:33 -0800 | [diff] [blame] | 26 | |
Janis Danisevskis | 670122f | 2021-01-17 22:20:11 -0800 | [diff] [blame] | 27 | #include "keystore2_engine.h" |
| 28 | |
Adam Langley | 1fb0583 | 2014-09-23 17:42:36 -0700 | [diff] [blame] | 29 | extern "C" { |
| 30 | |
| 31 | EVP_PKEY* EVP_PKEY_from_keystore(const char* key_id) __attribute__((visibility("default"))); |
| 32 | |
| 33 | /* EVP_PKEY_from_keystore returns an |EVP_PKEY| that contains either an RSA or |
| 34 | * ECDSA key where the public part of the key reflects the value of the key |
| 35 | * named |key_id| in Keystore and the private operations are forwarded onto |
| 36 | * KeyStore. */ |
| 37 | EVP_PKEY* EVP_PKEY_from_keystore(const char* key_id) { |
| 38 | ALOGV("EVP_PKEY_from_keystore(\"%s\")", key_id); |
| 39 | |
Janis Danisevskis | 2437fde | 2021-03-08 11:30:11 -0800 | [diff] [blame] | 40 | return EVP_PKEY_from_keystore2(key_id); |
Adam Langley | 1fb0583 | 2014-09-23 17:42:36 -0700 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | } // extern "C" |