Vanetza
Loading...
Searching...
No Matches
vanetza::security::pqc::CertificateView Class Reference

#include <certificate.hpp>

Inheritance diagram for vanetza::security::pqc::CertificateView:

Public Member Functions

 CertificateView (const asn1::EtsiTs103097Certificate *cert)
boost::optional< HashedId8 > calculate_digest () const
StartAndEndValidity get_start_and_end_validity () const
KeyType get_verification_key_type () const
boost::optional< HashedId8 > issuer_digest () const
bool issuer_is_self () const
bool is_ca_certificate () const
bool is_at_certificate () const
bool has_region_restriction () const
bool valid_at_location (const PositionFix &location, const LocationChecker *lc) const
bool valid_at_timepoint (const Clock::time_point &time_point) const
bool valid_for_application (ItsAid aid) const
bool is_allowed_to_issue (ItsAid aid) const
boost::optional< std::uint8_t > assurance_level () const
bool region_is_within (const CertificateView &issuer) const
bool is_canonical () const
boost::optional< Certificatecanonicalize () const
ByteBuffer encode () const

Protected Attributes

const asn1::EtsiTs103097Certificate * m_cert = nullptr

Detailed Description

Read-only view on a certificate

In contrast to Certificate, a view does not own the certificate data. A view can be created with low overhead as no heavy copying is required.

Definition at line 36 of file certificate.hpp.

Constructor & Destructor Documentation

◆ CertificateView()

vanetza::security::v3::CertificateView::CertificateView ( const asn1::EtsiTs103097Certificate * cert)
explicit

Definition at line 49 of file certificate.cpp.

Member Function Documentation

◆ assurance_level()

boost::optional< std::uint8_t > vanetza::security::v3::CertificateView::assurance_level ( ) const

Get subject assurance level encoded in this certificate.

Returns
raw assurance level byte if present

Definition at line 186 of file certificate.cpp.

◆ calculate_digest()

boost::optional< HashedId8 > vanetza::security::v3::CertificateView::calculate_digest ( ) const

Calculate digest of certificate

Returns
digest if possible

Definition at line 96 of file certificate.cpp.

◆ canonicalize()

Convert certificate into its canonical format if possible.

Returns
canonical certificate (or none if conversion failed)

Definition at line 350 of file certificate.cpp.

◆ encode()

Encode certificate.

Returns
encoded certificate

Definition at line 340 of file certificate.cpp.

◆ get_start_and_end_validity()

Get start and end validity

Returns
certificate start and end validity

Definition at line 271 of file certificate.cpp.

◆ get_verification_key_type()

Get verification key type

Returns
verification key type if possible; otherwise unspecified

Definition at line 101 of file certificate.cpp.

◆ has_region_restriction()

Check if certificate has an region restriction

Returns
true if certificate is only valid within a specific region

Definition at line 251 of file certificate.cpp.

◆ is_allowed_to_issue()

Check if certificate issue permissions allow issuing a given application.

Parameters
aidapplication to be checked
Returns
true if certificate may issue certificates for application

Definition at line 159 of file certificate.cpp.

◆ is_at_certificate()

Check if certificate is an Authorization Ticket certificate

Returns
true if certificate is an AT certificate

Definition at line 261 of file certificate.cpp.

◆ is_ca_certificate()

Check if certificate is a Certification Authority certificate

Returns
true if certificate is a CA certificate

Definition at line 256 of file certificate.cpp.

◆ is_canonical()

Check if certificate has a canonical format

Returns
true if certificate is in canonical format

Definition at line 266 of file certificate.cpp.

◆ issuer_digest()

boost::optional< HashedId8 > vanetza::security::v3::CertificateView::issuer_digest ( ) const

Get issuer digest (if any)

Returns
issuer digest

Definition at line 227 of file certificate.cpp.

◆ issuer_is_self()

Check if certificate is self-signed

Returns
true if certificate is self-signed

Definition at line 246 of file certificate.cpp.

◆ region_is_within()

bool vanetza::security::v3::CertificateView::region_is_within ( const CertificateView & issuer) const

Check if this certificate's region restriction is within issuer's region restriction.

If issuer has no region restriction, any subject region is accepted. Currently supports circular regions and exact rectangular-region equality; unsupported region combinations are rejected conservatively.

Parameters
issuerissuing certificate
Returns
true if this certificate's region is contained in issuer's region

Definition at line 195 of file certificate.cpp.

◆ valid_at_location()

bool vanetza::security::v3::CertificateView::valid_at_location ( const PositionFix & location,
const LocationChecker * lc ) const

Check if certificate is valid at given location

Parameters
locationlocation to be checked
Returns
true if certificate is valid at location

Definition at line 106 of file certificate.cpp.

◆ valid_at_timepoint()

bool vanetza::security::v3::CertificateView::valid_at_timepoint ( const Clock::time_point & time_point) const

Check if certificate is valid at given time point

Parameters
time_pointtime point to be checked
Returns
true if certificate is valid at time point

Definition at line 111 of file certificate.cpp.

◆ valid_for_application()

Check if certificate is valid for given application

Parameters
aidapplication to be checked
Returns
true if certificate is valid for application

Definition at line 154 of file certificate.cpp.

Member Data Documentation

◆ m_cert

const asn1::EtsiTs103097Certificate* vanetza::security::v3::CertificateView::m_cert = nullptr
protected

Definition at line 159 of file certificate.hpp.


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