Vanetza
Loading...
Searching...
No Matches
vanetza::security::v3::Certificate Struct Reference
Inheritance diagram for vanetza::security::v3::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 &)
Certificateoperator= (const Certificate &)
 Certificate (Certificate &&)
Certificateoperator= (Certificate &&)
ByteBuffer encode () const
void add_permission (ItsAid aid, const ByteBuffer &ssp)
void add_cert_permission (asn1::PsidGroupPermissions *group_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_canonical () const
boost::optional< Certificatecanonicalize () const

Protected Attributes

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

Detailed Description

Definition at line 133 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 47 of file asn1c_wrapper.hpp.

◆ base

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

Definition at line 219 of file asn1c_wrapper.hpp.

◆ Wrapper

Definition at line 135 of file certificate.hpp.

Constructor & Destructor Documentation

◆ Certificate() [1/4]

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

Definition at line 41 of file certificate.cpp.

◆ Certificate() [2/4]

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

Definition at line 48 of file certificate.cpp.

◆ Certificate() [3/4]

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

Definition at line 55 of file certificate.cpp.

◆ Certificate() [4/4]

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

Definition at line 69 of file certificate.cpp.

Member Function Documentation

◆ add_cert_permission()

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

Definition at line 593 of file certificate.cpp.

◆ add_permission()

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

Definition at line 572 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 83 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 284 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 119 of file asn1c_wrapper.hpp.

◆ content() [1/2]

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

Definition at line 82 of file asn1c_wrapper.hpp.

◆ content() [2/2]

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

Definition at line 81 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 242 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 237 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 247 of file asn1c_wrapper.hpp.

◆ encode()

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

Definition at line 279 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 205 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 88 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 185 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 195 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 190 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 200 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 161 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 180 of file certificate.cpp.

◆ operator!=()

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

Definition at line 89 of file asn1c_wrapper.hpp.

◆ operator*() [1/2]

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

Definition at line 75 of file asn1c_wrapper.hpp.

◆ operator*() [2/2]

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

Definition at line 77 of file asn1c_wrapper.hpp.

◆ operator->() [1/2]

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

Definition at line 76 of file asn1c_wrapper.hpp.

◆ operator->() [2/2]

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

Definition at line 78 of file asn1c_wrapper.hpp.

◆ operator=() [1/2]

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

Definition at line 75 of file certificate.cpp.

◆ operator=() [2/2]

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

Definition at line 61 of file certificate.cpp.

◆ operator==()

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

Definition at line 85 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 128 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 138 of file asn1c_wrapper.hpp.

◆ set_signature()

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

Definition at line 603 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 256 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 147 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 93 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 98 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 141 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 99 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 109 of file asn1c_wrapper.hpp.

Member Data Documentation

◆ m_cert

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

Definition at line 130 of file certificate.hpp.

◆ m_struct

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

Definition at line 154 of file asn1c_wrapper.hpp.

◆ m_type

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

Definition at line 155 of file asn1c_wrapper.hpp.


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