| OLD | NEW |
| 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 * | 4 * |
| 5 * Host-side functions for verified boot. | 5 * Host-side functions for verified boot. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef VBOOT_REFERENCE_HOST_KEY_H_ | 8 #ifndef VBOOT_REFERENCE_HOST_KEY_H_ |
| 9 #define VBOOT_REFERENCE_HOST_KEY_H_ | 9 #define VBOOT_REFERENCE_HOST_KEY_H_ |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 VbPublicKey* PublicKeyAlloc(uint64_t key_size, uint64_t algorithm, | 41 VbPublicKey* PublicKeyAlloc(uint64_t key_size, uint64_t algorithm, |
| 42 uint64_t version); | 42 uint64_t version); |
| 43 | 43 |
| 44 | 44 |
| 45 /* Copy a public key from [src] to [dest]. | 45 /* Copy a public key from [src] to [dest]. |
| 46 * | 46 * |
| 47 * Returns 0 if success, non-zero if error. */ | 47 * Returns 0 if success, non-zero if error. */ |
| 48 int PublicKeyCopy(VbPublicKey* dest, const VbPublicKey* src); | 48 int PublicKeyCopy(VbPublicKey* dest, const VbPublicKey* src); |
| 49 | 49 |
| 50 | 50 |
| 51 /* Read a public key from a file. Caller owns the returned pointer, | 51 /* Read a public key from a .vbpubk file. Caller owns the returned |
| 52 * and must free it with Free(). | 52 * pointer, and must free it with Free(). |
| 53 * | 53 * |
| 54 * Returns NULL if error. */ | 54 * Returns NULL if error. */ |
| 55 /* TODO: should really store public keys in files as VbPublicKey */ | 55 VbPublicKey* PublicKeyRead(const char* filename); |
| 56 VbPublicKey* PublicKeyRead(const char* filename, uint64_t algorithm, | 56 |
| 57 uint64_t version); | 57 |
| 58 /* Read a public key from a .keyb file. Caller owns the returned |
| 59 * pointer, and must free it with Free(). |
| 60 * |
| 61 * Returns NULL if error. */ |
| 62 VbPublicKey* PublicKeyReadKeyb(const char* filename, uint64_t algorithm, |
| 63 uint64_t version); |
| 64 |
| 65 |
| 66 /* Write a public key to a file in .vbpubk format. */ |
| 67 int PublicKeyWrite(const char* filename, const VbPublicKey* key); |
| 68 |
| 58 | 69 |
| 59 #endif /* VBOOT_REFERENCE_HOST_KEY_H_ */ | 70 #endif /* VBOOT_REFERENCE_HOST_KEY_H_ */ |
| OLD | NEW |