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

## 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