Vanetza
Loading...
Searching...
No Matches
vanetza::security::pqc::Certificate Struct Reference
Inheritance diagram for vanetza::security::pqc::Certificate:

Public Types

using Wrapper = asn1::asn1c_oer_wrapper<asn1::EtsiTs103097Certificate>
using base
typedef asn1::EtsiTs103097Certificate asn1c_type

Public Member Functions

 Certificate (const asn1::EtsiTs103097Certificate &)
 Certificate (const Certificate &)
 Certificate (Certificate &&)
Certificate & operator= (const Certificate &)
Certificate & operator= (Certificate &&)
ByteBuffer encode () const
void add_app_permission (ItsAid aid, const ByteBuffer &ssp)
 add application permissions as bitmap
void add_cert_issue_permission (asn1::PsidGroupPermissions *group_permission)
 add cert issuing permission
void set_signature (const SomeEcdsaSignature &signature)
bool decode (const ByteBuffer &buffer)
bool decode (ByteBuffer::const_iterator begin, ByteBuffer::const_iterator end)
bool decode (const void *buffer, std::size_t len)
std::size_t size () const
asn1c_type & operator* ()
const asn1c_type & operator* () const
asn1c_type * operator-> ()
const asn1c_type * operator-> () const
const asn1c_type * content () const
asn1c_type * content ()
bool operator== (const asn1c_wrapper_common &rhs) const
bool operator!= (const asn1c_wrapper_common &rhs) const
bool validate () const
bool validate (std::string &error) const
int compare (const asn1c_wrapper_common &other) const
int print () const
int print (FILE *stream) const
void swap (asn1c_wrapper_common &other) noexcept
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< Certificate > canonicalize () const

Protected Attributes

asn1c_type * m_struct
asn_TYPE_descriptor_t & m_type
const asn1::EtsiTs103097Certificate * m_cert = nullptr

Detailed Description

Definition at line 162 of file certificate.hpp.

Member Typedef Documentation

◆ asn1c_type

typedef asn1::EtsiTs103097Certificate vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::asn1c_type
inherited

Definition at line 79 of file asn1c_wrapper.hpp.

◆ base

using vanetza::asn1::asn1c_oer_wrapper< asn1::EtsiTs103097Certificate >::base
inherited

Definition at line 251 of file asn1c_wrapper.hpp.

◆ Wrapper

using vanetza::security::v3::Certificate::Wrapper = asn1::asn1c_oer_wrapper<asn1::EtsiTs103097Certificate>

Definition at line 164 of file certificate.hpp.

Constructor & Destructor Documentation

◆ Certificate() [1/4]

vanetza::security::v3::Certificate::Certificate ( )

Definition at line 54 of file certificate.cpp.

◆ Certificate() [2/4]

vanetza::security::v3::Certificate::Certificate ( const asn1::EtsiTs103097Certificate & cert)
explicit

Definition at line 61 of file certificate.cpp.

◆ Certificate() [3/4]

vanetza::security::v3::Certificate::Certificate ( const Certificate & other)

Definition at line 68 of file certificate.cpp.

◆ Certificate() [4/4]

vanetza::security::v3::Certificate::Certificate ( Certificate && other)

Definition at line 82 of file certificate.cpp.

Member Function Documentation

◆ add_app_permission()

void vanetza::security::v3::Certificate::add_app_permission ( ItsAid aid,
const ByteBuffer & ssp )

add application permissions as bitmap

Parameters
aidapplication identifier
ssppermission bitmap

Definition at line 637 of file certificate.cpp.

◆ add_cert_issue_permission()

void vanetza::security::v3::Certificate::add_cert_issue_permission ( asn1::PsidGroupPermissions * group_permission)

add cert issuing permission

Parameters
group_permissionto be added permission

Definition at line 659 of file certificate.cpp.

◆ assurance_level()

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

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
inherited

Calculate digest of certificate

Returns
digest if possible

Definition at line 96 of file certificate.cpp.

◆ canonicalize()

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

Convert certificate into its canonical format if possible.

Returns
canonical certificate (or none if conversion failed)

Definition at line 350 of file certificate.cpp.

◆ compare()

int vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::compare ( const asn1c_wrapper_common & other) const
inlineinherited

Compare ASN.1 types

Parameters
otherOther ASN.1 type to compare with
Returns
0 if equal, <0 if other is "greater", >0 if other is "smaller"

Definition at line 151 of file asn1c_wrapper.hpp.

◆ content() [1/2]

asn1c_type * vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::content ( )
inlineinherited

Definition at line 114 of file asn1c_wrapper.hpp.

◆ content() [2/2]

const asn1c_type * vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::content ( ) const
inlineinherited

Definition at line 113 of file asn1c_wrapper.hpp.

◆ decode() [1/3]

bool vanetza::asn1::asn1c_oer_wrapper< asn1::EtsiTs103097Certificate >::decode ( ByteBuffer::const_iterator begin,
ByteBuffer::const_iterator end )
inlineinherited

Definition at line 274 of file asn1c_wrapper.hpp.

◆ decode() [2/3]

bool vanetza::asn1::asn1c_oer_wrapper< asn1::EtsiTs103097Certificate >::decode ( const ByteBuffer & buffer)
inlineinherited

Try to decode ASN.1 struct from byte buffer

Parameters
bufferinput data
Deprecated
use decode_per instead
Returns
true if decoding has been successful

Definition at line 269 of file asn1c_wrapper.hpp.

◆ decode() [3/3]

bool vanetza::asn1::asn1c_oer_wrapper< asn1::EtsiTs103097Certificate >::decode ( const void * buffer,
std::size_t len )
inlineinherited

Definition at line 279 of file asn1c_wrapper.hpp.

◆ encode()

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

Definition at line 345 of file certificate.cpp.

◆ get_start_and_end_validity()

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

Get start and end validity

Returns
certificate start and end validity

Definition at line 271 of file certificate.cpp.

◆ get_verification_key_type()

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

Get verification key type

Returns
verification key type if possible; otherwise unspecified

Definition at line 101 of file certificate.cpp.

◆ has_region_restriction()

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

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()

bool vanetza::security::v3::CertificateView::is_allowed_to_issue ( ItsAid aid) const
inherited

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()

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

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()

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

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()

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

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
inherited

Get issuer digest (if any)

Returns
issuer digest

Definition at line 227 of file certificate.cpp.

◆ issuer_is_self()

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

Check if certificate is self-signed

Returns
true if certificate is self-signed

Definition at line 246 of file certificate.cpp.

◆ operator!=()

bool vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::operator!= ( const asn1c_wrapper_common & rhs) const
inlineinherited

Definition at line 121 of file asn1c_wrapper.hpp.

◆ operator*() [1/2]

asn1c_type & vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::operator* ( )
inlineinherited

Definition at line 107 of file asn1c_wrapper.hpp.

◆ operator*() [2/2]

const asn1c_type & vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::operator* ( ) const
inlineinherited

Definition at line 109 of file asn1c_wrapper.hpp.

◆ operator->() [1/2]

asn1c_type * vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::operator-> ( )
inlineinherited

Definition at line 108 of file asn1c_wrapper.hpp.

◆ operator->() [2/2]

const asn1c_type * vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::operator-> ( ) const
inlineinherited

Definition at line 110 of file asn1c_wrapper.hpp.

◆ operator=() [1/2]

Certificate & vanetza::security::v3::Certificate::operator= ( Certificate && other)

Definition at line 88 of file certificate.cpp.

◆ operator=() [2/2]

Certificate & vanetza::security::v3::Certificate::operator= ( const Certificate & other)

Definition at line 74 of file certificate.cpp.

◆ operator==()

bool vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::operator== ( const asn1c_wrapper_common & rhs) const
inlineinherited

Definition at line 117 of file asn1c_wrapper.hpp.

◆ print() [1/2]

int vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::print ( ) const
inlineinherited

Print ASN.1 type to standard output

Returns
0 on success, -1 on error

Definition at line 160 of file asn1c_wrapper.hpp.

◆ print() [2/2]

int vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::print ( FILE * stream) const
inlineinherited

Print ASN.1 type to some file stream

Parameters
streamOutput stream
Returns
0 on success, -1 on error

Definition at line 170 of file asn1c_wrapper.hpp.

◆ region_is_within()

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

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.

◆ set_signature()

void vanetza::security::v3::Certificate::set_signature ( const SomeEcdsaSignature & signature)

Definition at line 669 of file certificate.cpp.

◆ size()

std::size_t vanetza::asn1::asn1c_oer_wrapper< asn1::EtsiTs103097Certificate >::size ( ) const
inlineinherited

Get size of encoded ASN.1 struct

Returns
size in bytes

Definition at line 288 of file asn1c_wrapper.hpp.

◆ swap()

void vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::swap ( asn1c_wrapper_common & other)
inlinenoexceptinherited

Swap ASN.1 wrapper content

Parameters
otherwrapper

Definition at line 179 of file asn1c_wrapper.hpp.

◆ valid_at_location()

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

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
inherited

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()

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

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.

◆ validate() [1/2]

bool vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::validate ( ) const
inlineinherited

Check ASN.1 constraints

Parameters
error(optional) copy of error message
Returns
true if valid

Definition at line 131 of file asn1c_wrapper.hpp.

◆ validate() [2/2]

bool vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::validate ( std::string & error) const
inlineinherited

Check ASN.1 constraints

Parameters
errorError message if any constraint failed
Returns
true if valid

Definition at line 141 of file asn1c_wrapper.hpp.

Member Data Documentation

◆ m_cert

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

Definition at line 159 of file certificate.hpp.

◆ m_struct

asn1c_type* vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::m_struct
protectedinherited

Definition at line 186 of file asn1c_wrapper.hpp.

◆ m_type

asn_TYPE_descriptor_t& vanetza::asn1::asn1c_wrapper_common< asn1::EtsiTs103097Certificate >::m_type
protectedinherited

Definition at line 187 of file asn1c_wrapper.hpp.


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