Gaurav Shah | 431b988 | 2010-02-12 15:54:37 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 | * Use of this source code is governed by a BSD-style license that can be |
| 3 | * found in the LICENSE file. |
| 4 | * |
| 5 | * Utility functions for file and key handling. |
| 6 | */ |
| 7 | |
| 8 | #ifndef VBOOT_REFERENCE_FILE_KEYS_H_ |
| 9 | #define VBOOT_REFERENCE_FILE_KEYS_H_ |
| 10 | |
| 11 | #include "rsa.h" |
| 12 | |
| 13 | /* Read file named [input_file] into a buffer and stores the length into |
| 14 | * [len]. |
| 15 | * |
| 16 | * Returns a pointer to the buffer. Caller owns the returned pointer and |
| 17 | * must free it. |
| 18 | */ |
| 19 | uint8_t* BufferFromFile(char* input_file, int* len); |
| 20 | |
| 21 | /* Read a pre-processed RSA Public Key from file [input_file]. |
| 22 | * |
| 23 | * Returns a pointer to the read key. Caller owns the returned pointer and |
| 24 | * must free it. |
| 25 | */ |
| 26 | RSAPublicKey* RSAPublicKeyFromFile(char* input_file); |
| 27 | |
| 28 | #endif /* VBOOT_REFERENCE_FILE_KEYS_H_ */ |