libcamera
v0.8.0
Supporting cameras in Linux since 2019
Toggle main menu visibility
Loading...
Searching...
No Matches
pub_key.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
/*
3
* Copyright (C) 2020, Google Inc.
4
*
5
* Public key signature verification
6
*/
7
8
#pragma once
9
10
#include <span>
11
#include <stdint.h>
12
13
#if HAVE_CRYPTO
14
struct
evp_pkey_st;
15
#elif HAVE_GNUTLS
16
struct
gnutls_pubkey_st;
17
#endif
18
19
namespace
libcamera
{
20
21
class
PubKey
22
{
23
public
:
24
PubKey
(std::span<const uint8_t> key);
25
~PubKey
();
26
27
bool
isValid
()
const
{
return
valid_; }
28
bool
verify
(std::span<const uint8_t> data, std::span<const uint8_t> sig)
const
;
29
30
private
:
31
bool
valid_;
32
#if HAVE_CRYPTO
33
struct
evp_pkey_st *pubkey_;
34
#elif HAVE_GNUTLS
35
struct
gnutls_pubkey_st *pubkey_;
36
#endif
37
};
38
39
}
/* namespace libcamera */
libcamera::PubKey::verify
bool verify(std::span< const uint8_t > data, std::span< const uint8_t > sig) const
Verify signature on data.
Definition
pub_key.cpp:90
libcamera::PubKey::PubKey
PubKey(std::span< const uint8_t > key)
Construct a PubKey from key data.
Definition
pub_key.cpp:38
libcamera::PubKey::isValid
bool isValid() const
Check is the public key is valid.
Definition
pub_key.h:27
libcamera
Top-level libcamera namespace.
Definition
backtrace.h:17
include
libcamera
internal
pub_key.h
Generated by
1.17.0