Botan  2.4.0
Crypto and TLS for C++11
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Botan::Cert_Extension::Basic_Constraints Class Referencefinal

#include <x509_ext.h>

Inheritance diagram for Botan::Cert_Extension::Basic_Constraints:
Botan::Certificate_Extension

Public Member Functions

 Basic_Constraints (bool ca=false, size_t limit=0)
 
Basic_Constraintscopy () const override
 
bool get_is_ca () const
 
size_t get_path_limit () const
 
OID oid_of () const override
 
virtual void validate (const X509_Certificate &subject, const X509_Certificate &issuer, const std::vector< std::shared_ptr< const X509_Certificate >> &cert_path, std::vector< std::set< Certificate_Status_Code >> &cert_status, size_t pos)
 

Static Public Member Functions

static OID static_oid ()
 

Protected Member Functions

virtual bool should_encode () const
 

Detailed Description

Basic Constraints Extension

Definition at line 277 of file x509_ext.h.

Constructor & Destructor Documentation

◆ Basic_Constraints()

Botan::Cert_Extension::Basic_Constraints::Basic_Constraints ( bool  ca = false,
size_t  limit = 0 
)
inline

Definition at line 283 of file x509_ext.h.

283  :
284  m_is_ca(ca), m_path_limit(limit) {}

Member Function Documentation

◆ copy()

Basic_Constraints* Botan::Cert_Extension::Basic_Constraints::copy ( ) const
inlineoverridevirtual

Make a copy of this extension

Returns
copy of this

Implements Botan::Certificate_Extension.

Definition at line 280 of file x509_ext.h.

281  { return new Basic_Constraints(m_is_ca, m_path_limit); }
Basic_Constraints(bool ca=false, size_t limit=0)
Definition: x509_ext.h:283

◆ get_is_ca()

bool Botan::Cert_Extension::Basic_Constraints::get_is_ca ( ) const
inline

Definition at line 286 of file x509_ext.h.

Referenced by Botan::PKCS10_Request::is_CA(), and Botan::PKCS10_Request::path_limit().

286 { return m_is_ca; }

◆ get_path_limit()

size_t Botan::Cert_Extension::Basic_Constraints::get_path_limit ( ) const

Definition at line 276 of file x509_ext.cpp.

References Botan::PEM_Code::encode(), Botan::DER_Encoder::encode_if(), Botan::SEQUENCE, and Botan::DER_Encoder::start_cons().

Referenced by Botan::PKCS10_Request::path_limit().

277  {
278  if(!m_is_ca)
279  throw Invalid_State("Basic_Constraints::get_path_limit: Not a CA");
280  return m_path_limit;
281  }

◆ oid_of()

OID Botan::Cert_Extension::Basic_Constraints::oid_of ( ) const
inlineoverridevirtual
Returns
OID representing this extension

Implements Botan::Certificate_Extension.

Definition at line 290 of file x509_ext.h.

290 { return static_oid(); }

◆ should_encode()

virtual bool Botan::Certificate_Extension::should_encode ( ) const
inlineprotectedvirtualinherited

Definition at line 82 of file x509_ext.h.

82 { return true; }

◆ static_oid()

static OID Botan::Cert_Extension::Basic_Constraints::static_oid ( )
inlinestatic

Definition at line 289 of file x509_ext.h.

289 { return OID("2.5.29.19"); }

◆ validate()

void Botan::Certificate_Extension::validate ( const X509_Certificate subject,
const X509_Certificate issuer,
const std::vector< std::shared_ptr< const X509_Certificate >> &  cert_path,
std::vector< std::set< Certificate_Status_Code >> &  cert_status,
size_t  pos 
)
virtualinherited

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