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

#include <certificate.hpp>

Inheritance diagram for vanetza::security::v3::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_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 34 of file certificate.hpp.

Constructor & Destructor Documentation

◆ CertificateView()

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

Definition at line 36 of file certificate.cpp.

Member Function Documentation

◆ calculate_digest()

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

Calculate digest of certificate

Returns
digest if possible

Definition at line 83 of file certificate.cpp.

◆ canonicalize()

boost::optional< Certificate > vanetza::security::v3::CertificateView::canonicalize ( ) const

Convert certificate into its canonical format if possible.

Returns
canonical certificate (or none if conversion failed)

Definition at line 284 of file certificate.cpp.

◆ encode()

ByteBuffer vanetza::security::v3::CertificateView::encode ( ) const

Encode certificate.

Returns
encoded certificate

Definition at line 274 of file certificate.cpp.

◆ get_start_and_end_validity()

StartAndEndValidity vanetza::security::v3::CertificateView::get_start_and_end_validity ( ) const

Get start and end validity

Returns
certificate start and end validity

Definition at line 205 of file certificate.cpp.

◆ get_verification_key_type()

KeyType vanetza::security::v3::CertificateView::get_verification_key_type ( ) const

Get verification key type

Returns
verification key type if possible; otherwise unspecified

Definition at line 88 of file certificate.cpp.

◆ has_region_restriction()

bool vanetza::security::v3::CertificateView::has_region_restriction ( ) const

Check if certificate has an region restriction

Returns
true if certificate is only valid within a specific region

Definition at line 185 of file certificate.cpp.

◆ is_at_certificate()

bool vanetza::security::v3::CertificateView::is_at_certificate ( ) const

Check if certificate is an Authorization Ticket certificate

Returns
true if certificate is an AT certificate

Definition at line 195 of file certificate.cpp.

◆ is_ca_certificate()

bool vanetza::security::v3::CertificateView::is_ca_certificate ( ) const

Check if certificate is a Certification Authority certificate

Returns
true if certificate is a CA certificate

Definition at line 190 of file certificate.cpp.

◆ is_canonical()

bool vanetza::security::v3::CertificateView::is_canonical ( ) const

Check if certificate has a canonical format

Returns
true if certificate is in canonical format

Definition at line 200 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 161 of file certificate.cpp.

◆ issuer_is_self()

bool vanetza::security::v3::CertificateView::issuer_is_self ( ) const

Check if certificate is self-signed

Returns
true if certificate is self-signed

Definition at line 180 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 93 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 98 of file certificate.cpp.

◆ valid_for_application()

bool vanetza::security::v3::CertificateView::valid_for_application ( ItsAid aid) const

Check if certificate is valid for given application

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

Definition at line 141 of file certificate.cpp.

Member Data Documentation

◆ m_cert

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

Definition at line 130 of file certificate.hpp.


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