CPKIFKeyUsage Class Reference

#include <KeyUsage.h>

Inheritance diagram for CPKIFKeyUsage:

Inheritance graph
[legend]
Collaboration diagram for CPKIFKeyUsage:

Collaboration graph
[legend]

List of all members.


Detailed Description

CPKIFKeyUsage provides access to information found in a key usage extension. The ASN.1 definition used by PKIF is given below:
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"

Constructor & Destructor Documentation

CPKIFKeyUsage::CPKIFKeyUsage (  ) 

Interface: External

Default constructor

Returns:
None

Definition at line 42 of file KeyUsage.cpp.

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.

Returns:
None
Exceptions:
std::bad_alloc 
Parameters:
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.

Returns:
None

Definition at line 119 of file KeyUsage.cpp.


Member Function Documentation

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.

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.

Returns:
A Boolean indicating the value of the digital signature bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the non-repudiation bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the key encipherment bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the data encipherment bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the key agreement bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the certificate-signing bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the CRL-signing bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the encipher-only bit from a key usage extension.

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.

Returns:
A Boolean indicating the value of the decipher-only bit from a key usage extension.

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.

Returns:
None

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.

Returns:
None

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.

Returns:
None

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.

Returns:
None

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.

Returns:
None

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.

Returns:
None

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.

Returns:
None

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.

Returns:
None

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.

Returns:
None

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

Returns:
A bitset which represents key usage values in a 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.

Returns:
A smart pointer to a CPKIFBuffer object containing value of the extension.

Reimplemented from CPKIFX509Extension.

Definition at line 320 of file KeyUsage.cpp.


Member Data Documentation

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().


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

Generated on Mon Nov 15 11:20:23 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6