blob: 7d430999c0ee1aaa930f0f0e7d9e3de9b7364aff [file] [log] [blame]
Kenny Root17208e02013-09-04 13:56:03 -07001/*
2 * Copyright 2013 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 <hardware/keymaster.h>
18
19#ifndef SOFTKEYMASTER_INCLUDE_KEYMASTER_SOFTKEYMASTER_H
20#define SOFTKEYMASTER_INCLUDE_KEYMASTER_SOFTKEYMASTER_H
21
22int openssl_generate_keypair(const keymaster_device_t* dev,
23 const keymaster_keypair_t key_type, const void* key_params,
24 uint8_t** keyBlob, size_t* keyBlobLength);
25
26int openssl_import_keypair(const keymaster_device_t* dev,
27 const uint8_t* key, const size_t key_length,
28 uint8_t** key_blob, size_t* key_blob_length);
29
30int openssl_get_keypair_public(const struct keymaster_device* dev,
31 const uint8_t* key_blob, const size_t key_blob_length,
32 uint8_t** x509_data, size_t* x509_data_length);
33
34int openssl_sign_data(const keymaster_device_t* dev,
35 const void* params,
36 const uint8_t* keyBlob, const size_t keyBlobLength,
37 const uint8_t* data, const size_t dataLength,
38 uint8_t** signedData, size_t* signedDataLength);
39
40int openssl_verify_data(const keymaster_device_t* dev,
41 const void* params,
42 const uint8_t* keyBlob, const size_t keyBlobLength,
43 const uint8_t* signedData, const size_t signedDataLength,
44 const uint8_t* signature, const size_t signatureLength);
45
46#endif /* SOFTKEYMASTER_INCLUDE_KEYMASTER_SOFTKEYMASTER_H */