libcamera
v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
|
Public key wrapper for signature verification. More...
Public Member Functions | |
PubKey (Span< const uint8_t > key) | |
Construct a PubKey from key data. More... | |
bool | isValid () const |
Check is the public key is valid. More... | |
bool | verify (Span< const uint8_t > data, Span< const uint8_t > sig) const |
Verify signature on data. More... | |
Public key wrapper for signature verification.
The PubKey class wraps a public key and implements signature verification. It only supports RSA keys and the RSA-SHA256 signature algorithm.
libcamera::PubKey::PubKey | ( | Span< const uint8_t > | key | ) |
Construct a PubKey from key data.
[in] | key | Key data encoded in DER format |
|
inline |
Check is the public key is valid.
bool libcamera::PubKey::verify | ( | Span< const uint8_t > | data, |
Span< const uint8_t > | sig | ||
) | const |
Verify signature on data.
[in] | data | The signed data |
[in] | sig | The signature |
Verify that the signature sig matches the signed data for the public key. The signture algorithm is hardcoded to RSA-SHA256.