#include <KeyUsage.h>
KeyUsage ::= BIT STRING { digitalSignature (0), nonRepudiation (1), keyEncipherment (2), dataEncipherment (3), keyAgreement (4), keyCertSign (5), cRLSign (6), encipherOnly (7), decipherOnly (8) }
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: Yes
Definition at line 52 of file KeyUsage.h.
Public Member Functions | |
CPKIFKeyUsage () | |
CPKIFKeyUsage (const bool &criticality, const CPKIFBufferPtr &ext) | |
virtual | ~CPKIFKeyUsage () |
const CPKIFOIDPtr | oid () const |
bool | DigitalSignature () const |
bool | NonRepudiation () const |
bool | KeyEncipherment () const |
bool | DataEncipherment () const |
bool | KeyAgreement () const |
bool | KeyCertSign () const |
bool | CRLSign () const |
bool | EncipherOnly () const |
bool | DecipherOnly () const |
void | SetDigitalSignature () |
void | SetNonRepudiation () |
void | SetKeyEncipherment () |
void | SetDataEncipherment () |
void | SetKeyAgreement () |
void | SetKeyCertSign () |
void | SetCRLSign () |
void | SetEncipherOnly () |
void | SetDecipherOnly () |
std::bitset< 9 > | GetKeyUsage () |
CPKIFBufferPtr | value () const |
Static Public Attributes | |
static char | extOID [] = "2.5.29.15" |
CPKIFKeyUsage::CPKIFKeyUsage | ( | ) |
CPKIFKeyUsage::CPKIFKeyUsage | ( | 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.
std::bad_alloc |
criticality | [in] Boolean value indication criticallity |
ext | [in] A reference to a smart pointer to CPKIFBuffer object containing DER encoded KeyUsage extension |
Definition at line 58 of file KeyUsage.cpp.
References CACASNWRAPPER_CREATE.
CPKIFKeyUsage::~CPKIFKeyUsage | ( | ) | [virtual] |
Interface: External
The function destroys an instance of CPKIFKeyUsage.
Definition at line 119 of file KeyUsage.cpp.
const CPKIFOIDPtr CPKIFKeyUsage::oid | ( | ) | const [virtual] |
Interface: External
This function returns a smart pointer to a CPKIFOID object containing the object identifier value that identifier this type of extension.
Reimplemented from CPKIFX509Extension.
Definition at line 135 of file KeyUsage.cpp.
References extOID.
Referenced by CPKIFGeneralCertificateDetailsPanel::OnInitDialog().
bool CPKIFKeyUsage::DigitalSignature | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the digital signature bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 151 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::NonRepudiation | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the non-repudiation bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 160 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::KeyEncipherment | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the key encipherment bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 169 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::DataEncipherment | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the data encipherment bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 179 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::KeyAgreement | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the key agreement bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 188 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::KeyCertSign | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the certificate-signing bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 197 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::CRLSign | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the CRL-signing bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 206 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::EncipherOnly | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the encipher-only bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 215 of file KeyUsage.cpp.
Referenced by operator<<().
bool CPKIFKeyUsage::DecipherOnly | ( | ) | const |
Interface: External
This function returns a Boolean indicating the value of the decipher-only bit from a key usage extension. The function returns true if the bit is set and false otherwise.
Definition at line 224 of file KeyUsage.cpp.
Referenced by operator<<().
void CPKIFKeyUsage::SetDigitalSignature | ( | ) |
Interface: External
This function sets the digital signature bit from a key usage extension.
Definition at line 233 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetNonRepudiation | ( | ) |
Interface: External
This function sets the value of the non-repudiation bit from a key usage extension.
Definition at line 241 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetKeyEncipherment | ( | ) |
Interface: External
This function sets the value of the key encipherment bit from a key usage extension.
Definition at line 249 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetDataEncipherment | ( | ) |
Interface: External
This function sets the value of the data encipherment bit from a key usage extension.
Definition at line 258 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetKeyAgreement | ( | ) |
Interface: External
This function sets the value of the key agreement bit from a key usage extension.
Definition at line 266 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetKeyCertSign | ( | ) |
Interface: External
This function sets the value of the certificate-signing bit from a key usage extension.
Definition at line 275 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetCRLSign | ( | ) |
Interface: External
This function sets the value of the CRL-signing bit from a key usage extension.
Definition at line 283 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetEncipherOnly | ( | ) |
Interface: External
This function sets the value of the encipher-only bit from a key usage extension.
Definition at line 291 of file KeyUsage.cpp.
void CPKIFKeyUsage::SetDecipherOnly | ( | ) |
Interface: External
This function sets the decipher-only bit from a key usage extension.
Definition at line 299 of file KeyUsage.cpp.
bitset< 9 > CPKIFKeyUsage::GetKeyUsage | ( | ) |
Interface: External
This function returns a bitset representing the key usage for the KeyUsage extension
Definition at line 308 of file KeyUsage.cpp.
CPKIFBufferPtr CPKIFKeyUsage::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 320 of file KeyUsage.cpp.
char CPKIFKeyUsage::extOID = "2.5.29.15" [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.15".
Definition at line 63 of file KeyUsage.h.
Referenced by oid(), and CPKIFKeyUsageFactory::refOID().