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

CODEX_ASN1::BigNumber Class Reference

Serializable representation of an OpenSSL BIGNUM. More...

#include <BigNumber.h>

Inheritance diagram for CODEX_ASN1::BigNumber:

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

Collaboration graph
[legend]
List of all members.

Public Methods

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

 BigNumber (BIGNUM *pBN)
 Create a BigNumber from a BIGNUM, taking ownership of the memory.

 BigNumber (const ASN1_INTEGER *asn1)
 Create a BigNumber from an ASN1_INTEGER.

 BigNumber (const BigNumber &aBN)
 Create a BigNumber from another BigNumber, copying the memory.

virtual ~BigNumber ()
 Destructor -- frees the stored BIGNUM and ASN1_INTEGER.

void operator= (const BigNumber &aBN)
 Assignment operator.

void operator= (BIGNUM *pBN)
 Assignment operator for BIGNUM%s(takes ownership of argument).

bool operator== (const BigNumber &aBN) const
 Equality operator.

bool operator!= (const BigNumber &aBN) const
 Inequality operator.

bool operator< (const BigNumber &aBN) const
 Less-than operator.

bool operator> (const BigNumber &aBN) const
 Less-than operator.

const BIGNUM * value () const
 
Returns:
BIGNUM structure


const ASN1_INTEGER * asn1 () const
 
Returns:
ASN1_INTEGER corresponding to the BIGNUM


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.


Protected Attributes

BIGNUM * m_value
 BigNumber as an OpenSSL BIGNUM.

ASN1_INTEGER * m_asn1
 BigNumber as an ASN.1 integer.


Detailed Description

Serializable representation of an OpenSSL BIGNUM.

From the perspective of ASN.1 encoding, a BIGNUM is just an integer.

Definition at line 31 of file BigNumber.h.


Member Function Documentation

int BigNumber::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 145 of file BigNumber.cc.

References asn1(), and m_asn1.

Referenced by CODEX_Ciphers::VarRSAPrivateKey::decrypt(), CODEX_ThresholdCrypto::DLProof::DLProof(), CODEX_Ciphers::VarRSAPublicKey::encrypt(), CODEX_Ciphers::ElGamalPublicKey::encryptS(), CODEX_Server::QuorumBuilderAct::handler(), CODEX_KeyService::ClientResponseSigner::handler(), CODEX_Ciphers::VarRSACipherText::marshal(), CODEX_Ciphers::VarRSABlindPlainText::marshal(), CODEX_Ciphers::VarRSABlindCipherText::marshal(), CODEX_Ciphers::TranslationCertificate::marshal(), CODEX_KeyService::KeyInfo::marshal(), CODEX_Server::ServerSignature::marshal(), CODEX_Ciphers::RSAPublicKey::marshal(), CODEX_Ciphers::RSAPrivateKey::marshal(), CODEX_Client::ReadKeyMsg::marshal(), CODEX_Ciphers::PolCredBase::marshal(), CODEX_VSS::ModExpFunctionalArgs::marshal(), CODEX_Client::KeyStoredMsg::marshal(), CODEX_Ciphers::ElGamalSignature::marshal(), CODEX_Ciphers::ElGamalSchnorrCipherText::marshal(), CODEX_Ciphers::ElGamalPublicKey::marshal(), CODEX_Ciphers::ElGamalCipherText::marshal(), CODEX_ThresholdCrypto::DLProof::marshal(), CODEX_VSS::Combinatoric< NumT, ThreshT >::marshal(), CODEX_Client::BlindKeyMsg::marshal(), CODEX_Server::SignedAugmentedEGPublicKey::marshal(), CODEX_Server::AugmentedEGPublicKey::marshal(), CODEX_Server::InternalVerifier::processRequest(), CODEX_Ciphers::RSAPlaintextPK::RSAPlaintextPK(), CODEX_Ciphers::ElGamalPrivateKey::toFile(), CODEX_Client::Client::toFile(), CODEX_Ciphers::TranslationCertificate::TranslationCertificate(), CODEX_Ciphers::VarRSABlindPlainText::unblind(), CODEX_Ciphers::TranslationCertificate::verify(), CODEX_Ciphers::RSAPlaintextPK::verify(), CODEX_Ciphers::ElGamalSchnorrCipherText::verify(), and CODEX_ThresholdCrypto::DLProof::verify().

void * BigNumber::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 152 of file BigNumber.cc.

References m_asn1, CODEX_ASN1::Base::m_initialized, and m_value.

Referenced by CODEX_Ciphers::ElGamalPrivateKey::fromFile(), CODEX_Client::Client::fromFile(), CODEX_Server::QuorumBuilderAct::handler(), CODEX_KeyService::VerifyWriteCallback::operator()(), CODEX_KeyService::ClientWriteCallback::operator()(), CODEX_KeyService::ClientCreateCallback::operator()(), CODEX_Server::InternalVerifier::processRequest(), CODEX_Ciphers::VarRSACipherText::unmarshal(), CODEX_Ciphers::VarRSABlindPlainText::unmarshal(), CODEX_Ciphers::VarRSABlindCipherText::unmarshal(), CODEX_Ciphers::TranslationCertificate::unmarshal(), CODEX_KeyService::KeyInfo::unmarshal(), CODEX_Server::ServerSignature::unmarshal(), CODEX_Ciphers::RSAPublicKey::unmarshal(), CODEX_Ciphers::RSAPrivateKey::unmarshal(), CODEX_Client::ReadKeyMsg::unmarshal(), CODEX_Ciphers::PolCredBase::unmarshal(), CODEX_VSS::ModExpFunctionalArgs::unmarshal(), CODEX_Client::KeyStoredMsg::unmarshal(), CODEX_Ciphers::ElGamalSignature::unmarshal(), CODEX_Ciphers::ElGamalSchnorrCipherText::unmarshal(), CODEX_Ciphers::ElGamalPublicKey::unmarshal(), CODEX_Ciphers::ElGamalCipherText::unmarshal(), CODEX_ThresholdCrypto::DLProof::unmarshal(), CODEX_Client::BlindKeyMsg::unmarshal(), CODEX_Server::SignedAugmentedEGPublicKey::unmarshal(), and CODEX_Server::AugmentedEGPublicKey::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