Botan 3.6.1
Crypto and TLS for C&
Botan::Cert_Extension::Certificate_Policies Class Referencefinal

#include <x509_ext.h>

Inheritance diagram for Botan::Cert_Extension::Certificate_Policies:
Botan::Certificate_Extension

Public Member Functions

 Certificate_Policies ()=default
 
 Certificate_Policies (const std::vector< OID > &o)
 
std::unique_ptr< Certificate_Extensioncopy () const override
 
const std::vector< OID > & get_policy_oids () const
 
OID oid_of () const override
 
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) override
 

Static Public Member Functions

static OID static_oid ()
 

Detailed Description

Certificate Policies Extension

Definition at line 268 of file x509_ext.h.

Constructor & Destructor Documentation

◆ Certificate_Policies() [1/2]

Botan::Cert_Extension::Certificate_Policies::Certificate_Policies ( )
default

◆ Certificate_Policies() [2/2]

Botan::Cert_Extension::Certificate_Policies::Certificate_Policies ( const std::vector< OID > & o)
inlineexplicit

Definition at line 276 of file x509_ext.h.

276: m_oids(o) {}

Member Function Documentation

◆ copy()

std::unique_ptr< Certificate_Extension > Botan::Cert_Extension::Certificate_Policies::copy ( ) const
inlineoverridevirtual

Make a copy of this extension

Returns
copy of this

Implements Botan::Certificate_Extension.

Definition at line 270 of file x509_ext.h.

270 {
271 return std::make_unique<Certificate_Policies>(m_oids);
272 }

◆ get_policy_oids()

const std::vector< OID > & Botan::Cert_Extension::Certificate_Policies::get_policy_oids ( ) const
inline

Definition at line 278 of file x509_ext.h.

278{ return m_oids; }

◆ oid_of()

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

Implements Botan::Certificate_Extension.

Definition at line 282 of file x509_ext.h.

282{ return static_oid(); }

◆ static_oid()

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

Definition at line 280 of file x509_ext.h.

280{ return OID("2.5.29.32"); }

◆ validate()

void Botan::Cert_Extension::Certificate_Policies::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 )
overridevirtual

Reimplemented from Botan::Certificate_Extension.

Definition at line 607 of file x509_ext.cpp.

611 {
612 std::set<OID> oid_set(m_oids.begin(), m_oids.end());
613 if(oid_set.size() != m_oids.size()) {
614 cert_status.at(pos).insert(Certificate_Status_Code::DUPLICATE_CERT_POLICY);
615 }
616}

References Botan::DUPLICATE_CERT_POLICY.


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