CCF
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ccf::crypto::Verifier_OpenSSL Class Reference

#include <verifier.h>

Inherits ccf::crypto::Verifier.

Public Member Functions

 Verifier_OpenSSL (const std::vector< uint8_t > &c)
 
 Verifier_OpenSSL (Verifier_OpenSSL &&v)=default
 
 Verifier_OpenSSL (const Verifier_OpenSSL &)=delete
 
virtual ~Verifier_OpenSSL ()
 
virtual std::vector< uint8_t > cert_der () override
 
virtual Pem cert_pem () override
 
virtual bool verify_certificate (const std::vector< const Pem * > &trusted_certs, const std::vector< const Pem * > &chain={}, bool ignore_time=false) override
 
virtual bool is_self_signed () const override
 
virtual std::string serial_number () const override
 
virtual std::pair< std::string, std::string > validity_period () const override
 
virtual size_t remaining_seconds (const std::chrono::system_clock::time_point &now) const override
 
virtual double remaining_percentage (const std::chrono::system_clock::time_point &now) const override
 
virtual std::string subject () const override
 
- Public Member Functions inherited from ccf::crypto::Verifier
 Verifier ()
 
virtual ~Verifier ()
 
virtual bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *sig, size_t sig_size, MDType md_type=MDType::NONE) const
 
virtual bool verify (std::span< const uint8_t > contents, std::span< const uint8_t > sig, MDType md_type=MDType::NONE) const
 
virtual bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *sig, size_t sig_size, MDType md_type, HashBytes &hash_bytes) const
 
virtual bool verify (const std::vector< uint8_t > &contents, const std::vector< uint8_t > &signature, MDType md_type=MDType::NONE) const
 
virtual bool verify (const std::vector< uint8_t > &contents, const std::vector< uint8_t > &signature, MDType md_type, HashBytes &hash_bytes) const
 
virtual bool verify_hash (const uint8_t *hash, size_t hash_size, const uint8_t *sig, size_t sig_size, MDType md_type=MDType::NONE)
 
virtual bool verify_hash (const std::vector< uint8_t > &hash, const std::vector< uint8_t > &signature, MDType md_type=MDType::NONE)
 
template<size_t SIZE>
bool verify_hash (const std::array< uint8_t, SIZE > &hash, const std::vector< uint8_t > &signature, MDType md_type=MDType::NONE)
 
virtual Pem public_key_pem () const
 
virtual std::vector< uint8_t > public_key_der () const
 
virtual JsonWebKeyECPublic public_key_jwk (const std::optional< std::string > &kid=std::nullopt) const
 

Static Protected Member Functions

static MDType get_md_type (int mdt)
 

Protected Attributes

OpenSSL::Unique_X509 cert
 
- Protected Attributes inherited from ccf::crypto::Verifier
std::shared_ptr< PublicKeypublic_key
 

Constructor & Destructor Documentation

◆ Verifier_OpenSSL() [1/3]

ccf::crypto::Verifier_OpenSSL::Verifier_OpenSSL ( const std::vector< uint8_t > &  c)

◆ Verifier_OpenSSL() [2/3]

ccf::crypto::Verifier_OpenSSL::Verifier_OpenSSL ( Verifier_OpenSSL &&  v)
default

◆ Verifier_OpenSSL() [3/3]

ccf::crypto::Verifier_OpenSSL::Verifier_OpenSSL ( const Verifier_OpenSSL )
delete

◆ ~Verifier_OpenSSL()

ccf::crypto::Verifier_OpenSSL::~Verifier_OpenSSL ( )
virtualdefault

Member Function Documentation

◆ cert_der()

std::vector< uint8_t > ccf::crypto::Verifier_OpenSSL::cert_der ( )
overridevirtual

Implements ccf::crypto::Verifier.

◆ cert_pem()

Pem ccf::crypto::Verifier_OpenSSL::cert_pem ( )
overridevirtual

Implements ccf::crypto::Verifier.

◆ get_md_type()

MDType ccf::crypto::Verifier_OpenSSL::get_md_type ( int  mdt)
staticprotected

◆ is_self_signed()

bool ccf::crypto::Verifier_OpenSSL::is_self_signed ( ) const
overridevirtual

Indicates whether the certificate (held intenally) is self-signed

Implements ccf::crypto::Verifier.

◆ remaining_percentage()

double ccf::crypto::Verifier_OpenSSL::remaining_percentage ( const std::chrono::system_clock::time_point &  now) const
overridevirtual

The percentage of the validity period of the certificate remaining

Implements ccf::crypto::Verifier.

◆ remaining_seconds()

size_t ccf::crypto::Verifier_OpenSSL::remaining_seconds ( const std::chrono::system_clock::time_point &  now) const
overridevirtual

The number of seconds of the validity period of the certificate remaining

Implements ccf::crypto::Verifier.

◆ serial_number()

std::string ccf::crypto::Verifier_OpenSSL::serial_number ( ) const
overridevirtual

The serial number of the certificate

Implements ccf::crypto::Verifier.

◆ subject()

std::string ccf::crypto::Verifier_OpenSSL::subject ( ) const
overridevirtual

The subject name of the certificate

Implements ccf::crypto::Verifier.

◆ validity_period()

std::pair< std::string, std::string > ccf::crypto::Verifier_OpenSSL::validity_period ( ) const
overridevirtual

The validity period of the certificate

Implements ccf::crypto::Verifier.

◆ verify_certificate()

bool ccf::crypto::Verifier_OpenSSL::verify_certificate ( const std::vector< const Pem * > &  trusted_certs,
const std::vector< const Pem * > &  chain = {},
bool  ignore_time = false 
)
overridevirtual

Verify the certificate (held internally)

Parameters
trusted_certsVector of trusted certificates
chainVector of ordered untrusted certificates used to build a chain to trusted certificates
ignore_timeFlag to disable certificate expiry checks
Returns
true if the verification is successful

Implements ccf::crypto::Verifier.

Member Data Documentation

◆ cert

OpenSSL::Unique_X509 ccf::crypto::Verifier_OpenSSL::cert
mutableprotected

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