libcamera: libcamera::PubKey Class Reference

libcamera v0.0.4 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
Public Member Functions | List of all members
libcamera::PubKey Class Reference

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.

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ PubKey()

libcamera::PubKey::PubKey | ( | Span< const uint8_t > | key | ) |

Construct a PubKey from key data.

Parameters

  [in] | key | Key data encoded in DER format

## Member Function Documentation

## ◆ isValid()

bool libcamera::PubKey::isValid | ( |  | ) | const
| inline

Check is the public key is valid.

Returns
  True if the public key is valid, false otherwise

## ◆ verify()

bool libcamera::PubKey::verify | ( | Span< const uint8_t > | data,
|  | Span< const uint8_t > | sig
| ) |  | const

Verify signature on data.

Parameters

  [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.

Returns
  True if the signature is valid, false otherwise

The documentation for this class was generated from the following files:

- include/libcamera/internal/pub_key.h
- src/libcamera/pub_key.cpp