Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

CODEX_ASN1::Certificate Class Reference

Object encapsulation of a serializable X.509 certificate. More...

#include <Certificate.h>

Inheritance diagram for CODEX_ASN1::Certificate:

Inheritance graph
[legend]
Collaboration diagram for CODEX_ASN1::Certificate:

Collaboration graph
[legend]
List of all members.

Public Methods

 Certificate ()
 Default constructor, for creating an object to be unmarshalled.

 Certificate (X509 *value)
 Create a Certificate from an X.509 structure, taking ownership.

 Certificate (const Certificate &aCert)
 Create a Certificate from another Certificate.

virtual ~Certificate ()
 Destructor -- frees the stored X.509 certificate.

void operator= (const Certificate &aCert)
 Assignment operator.

const X509 * value () const
 
Returns:
X.509 structure


int marshal (unsigned char **pp) const
 This function creates a serialized representation of the object, which is returned through the argument pp.

void * unmarshal (void *bogus, unsigned char **pp, long length)
 This function takes a serialized representation of the object and recreates the object representation.

void * fromPEMFile (const char *fname)
 Read a certificate from a PEM-format file.


Detailed Description

Object encapsulation of a serializable X.509 certificate.

Definition at line 29 of file Certificate.h.


Member Function Documentation

void * Certificate::fromPEMFile const char *    fname
 

Read a certificate from a PEM-format file.

Parameters:
fname  The file name to read.
Returns:
0 on failure.

Definition at line 87 of file Certificate.cc.

References CODEX_ASN1::Base::m_initialized.

Referenced by CODEX_Server::ServerState::configure(), CODEX_Server::ServerState::readCACert(), and CODEX_Server::ServerState::readServiceCert().

int Certificate::marshal unsigned char **    pp const [virtual]
 

This function creates a serialized representation of the object, which is returned through the argument pp.

This must be overridden by the concrete derived class.

Parameters:
pp  Serialized form of the object
Returns:
Length of the marshalled data

Implements CODEX_ASN1::Base.

Definition at line 66 of file Certificate.cc.

Referenced by CODEX_Client::CreateKeyMsg::marshal(), and CODEX_Client::Client::toFile().

void * Certificate::unmarshal void *    bogus,
unsigned char **    pp,
long    length
[virtual]
 

This function takes a serialized representation of the object and recreates the object representation.

This must be overridden by the concrete derived class.

Parameters:
bogus  Included for compatibility with OpenSSL ASN.1 macros
pp  Serialized form of the data
length  Number of bytes of pp to unmarshal
Returns:
success or failure of the unmarshalling

Implements CODEX_ASN1::Base.

Definition at line 72 of file Certificate.cc.

References CODEX_ASN1::Base::m_initialized.

Referenced by CODEX_Client::Client::fromFile(), and CODEX_Client::CreateKeyMsg::unmarshal().


The documentation for this class was generated from the following files:
Generated on Wed Jun 2 16:33:03 2004 for COrnell Data EXchange (CODEX) by doxygen1.2.18