File Index
Files and directories
Sign in
FILE

turris-signing-key.h

File preview with syntax highlighting.

linux-6.19.14/include/linux/turris-signing-key.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * 2025 by Marek BehĂșn <kabel@kernel.org>
 4 */
 5
 6#ifndef __TURRIS_SIGNING_KEY_H
 7#define __TURRIS_SIGNING_KEY_H
 8
 9#include <linux/key.h>
10#include <linux/types.h>
11
12struct device;
13
14#ifdef CONFIG_KEYS
15struct turris_signing_key_subtype {
16	u16 key_size;
17	u8 data_size;
18	u8 sig_size;
19	u8 public_key_size;
20	const char *hash_algo;
21	const void *(*get_public_key)(const struct key *key);
22	int (*sign)(const struct key *key, const void *msg, void *signature);
23};
24
25static inline struct device *turris_signing_key_get_dev(const struct key *key)
26{
27	return key->payload.data[1];
28}
29
30int
31devm_turris_signing_key_create(struct device *dev, const struct turris_signing_key_subtype *subtype,
32			       const char *desc);
33#endif
34
35#endif /* __TURRIS_SIGNING_KEY_H */
~/ Read-only file preview.