Botan 3.6.1
Crypto and TLS for C&
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)
 
std::unique_ptr< Certificate_Extensioncopy () 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< 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 25 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 31 of file x509_ext.h.

31: m_is_ca(ca), m_path_limit(limit) {}

Member Function Documentation

◆ copy()

std::unique_ptr< Certificate_Extension > 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 27 of file x509_ext.h.

27 {
28 return std::make_unique<Basic_Constraints>(m_is_ca, m_path_limit);
29 }

◆ get_is_ca()

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

Definition at line 33 of file x509_ext.h.

33{ return m_is_ca; }

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

◆ get_path_limit()

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

Definition at line 296 of file x509_ext.cpp.

296 {
297 if(!m_is_ca) {
298 throw Invalid_State("Basic_Constraints::get_path_limit: Not a CA");
299 }
300 return m_path_limit;
301}

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

◆ oid_of()

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

Implements Botan::Certificate_Extension.

Definition at line 39 of file x509_ext.h.

39{ return static_oid(); }

◆ should_encode()

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

Definition at line 456 of file pkix_types.h.

456{ return true; }

◆ static_oid()

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

Definition at line 37 of file x509_ext.h.

37{ return OID("2.5.29.19"); }

◆ validate()

void Botan::Certificate_Extension::validate ( const X509_Certificate & subject,
const X509_Certificate & issuer,
const std::vector< 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: