Public key wrapper for signature verification. More...
Public Member Functions | |
| PubKey (Span< const uint8_t > key) | |
| Construct a PubKey from key data. | |
| bool | isValid () const |
| Check is the public key is valid. | |
| bool | verify (Span< const uint8_t > data, Span< const uint8_t > sig) const |
| Verify signature on data. | |
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.