#include <BasicConstraints.h>
BasicConstraints ::= SEQUENCE {
cA BOOLEAN DEFAULT FALSE,
pathLenConstraint INTEGER (0..MAX) OPTIONAL }
For details on accessing extensions in a certificate or CRL, see the sections on CPKIFCertificate and CPKIFCRL. PKIF does not provide a means of encoding extensions. This class is used to parse extensions present in encoded objects, e.g. public-key certificates.
TSP-enforcing: No
Definition at line 46 of file BasicConstraints.h.
Public Member Functions | |
CPKIFBasicConstraints () | |
CPKIFBasicConstraints (const bool &criticality, const CPKIFBufferPtr &ext) | |
virtual | ~CPKIFBasicConstraints () |
const CPKIFOIDPtr | oid () const |
bool | isCA () const |
int | pathLength () const |
bool | pathLengthPresent () const |
CPKIFBufferPtr | value () const |
void | SetIsCA (bool b) |
void | SetPathLength (int pl) |
Static Public Attributes | |
static char | extOID [] = "2.5.29.19" |
CPKIFBasicConstraints::CPKIFBasicConstraints | ( | ) |
Interface: External
Defaul constructor set isCA = false, pathLengthPresent = false
Definition at line 49 of file BasicConstraints.cpp.
CPKIFBasicConstraints::CPKIFBasicConstraints | ( | const bool & | criticality, | |
const CPKIFBufferPtr & | ext | |||
) |
Interface: External
This constructor is internally invoked; this version will throw a std::bad_alloc exception if allocation of memory fails or ASN.1 decoding errors if the extension cannot be parsed. The cA property is initialized to false and the pathLenConstraint property is initialized to absent.
std::bad_alloc | Interface: External |
std::bad_alloc |
Definition at line 96 of file BasicConstraints.cpp.
References CACASNWRAPPER_CREATE.
CPKIFBasicConstraints::~CPKIFBasicConstraints | ( | ) | [virtual] |
Interface: External
The function destroys an instance of CPKIFBasicConstraints.
Definition at line 120 of file BasicConstraints.cpp.
const CPKIFOIDPtr CPKIFBasicConstraints::oid | ( | ) | const [virtual] |
Interface: External
This function returns a smart pointer to a CPKIFOID object containing the object identifier associated with this type of extension.
Reimplemented from CPKIFX509Extension.
Definition at line 176 of file BasicConstraints.cpp.
References extOID.
bool CPKIFBasicConstraints::isCA | ( | ) | const |
Interface: External
This function returns a Boolean value indicating whether the entity associated with the certificate containing the basic constraints extension is a CA or an end entity.
Definition at line 151 of file BasicConstraints.cpp.
Referenced by operator<<(), and value().
int CPKIFBasicConstraints::pathLength | ( | ) | const |
Interface: External
This function returns an integer containing the path length value from a basic constraints extension. This value is only meaningful when the pathLengthPresent function returns true.
Definition at line 164 of file BasicConstraints.cpp.
Referenced by operator<<(), and value().
bool CPKIFBasicConstraints::pathLengthPresent | ( | ) | const |
Interface: External
A bool indicating if the basic constraints extension contains a path length value.
Definition at line 139 of file BasicConstraints.cpp.
Referenced by operator<<(), and value().
CPKIFBufferPtr CPKIFBasicConstraints::value | ( | ) | const [virtual] |
Interface: External
This function returns a smart pointer to a CPKIFBuffer object containing value of the extension.
Reimplemented from CPKIFX509Extension.
Definition at line 192 of file BasicConstraints.cpp.
References CACASNWRAPPER_CREATE, isCA(), pathLength(), and pathLengthPresent().
void CPKIFBasicConstraints::SetIsCA | ( | bool | b | ) |
Definition at line 240 of file BasicConstraints.cpp.
void CPKIFBasicConstraints::SetPathLength | ( | int | pl | ) |
Definition at line 246 of file BasicConstraints.cpp.
char CPKIFBasicConstraints::extOID = "2.5.29.19" [static] |
The extOID member of each extension class provides a NULL terminated string representation of the object identifier that identifies the extension. The value defined for this class is "2.5.29.19".
Definition at line 57 of file BasicConstraints.h.
Referenced by oid(), and CPKIFBasicConstraintsFactory::refOID().