libcamera  v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
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. 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]keyKey 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]dataThe signed data
[in]sigThe 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: