reSIProcate/stack  9694
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
resip::Pkcs7Contents Class Reference

SIP body type for holding PKCS7 contents (MIME content-type application/pkcs7-mime). More...

#include <Pkcs7Contents.hxx>

Inheritance diagram for resip::Pkcs7Contents:
Inheritance graph
[legend]
Collaboration diagram for resip::Pkcs7Contents:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Pkcs7Contents ()
 Pkcs7Contents (const Data &text)
 Pkcs7Contents (const HeaderFieldValue &hfv, const Mime &contentType)
 Pkcs7Contents (const Data &data, const Mime &contentType)
 Pkcs7Contents (const Pkcs7Contents &rhs)
virtual ~Pkcs7Contents ()
Pkcs7Contentsoperator= (const Pkcs7Contents &rhs)
virtual Contentsclone () const
 duplicate an Pkcs7Contents object
virtual EncodeStreamencodeParsed (EncodeStream &str) const
virtual void parse (ParseBuffer &pb)

Static Public Member Functions

static const MimegetStaticType ()
static bool init ()

Static Public Attributes

static const Pkcs7Contents Empty

Private Attributes

Data mText

Detailed Description

SIP body type for holding PKCS7 contents (MIME content-type application/pkcs7-mime).

Definition at line 14 of file Pkcs7Contents.hxx.


Constructor & Destructor Documentation

Pkcs7Contents::Pkcs7Contents ( )

Definition at line 35 of file Pkcs7Contents.cxx.

Referenced by clone().

Pkcs7Contents::Pkcs7Contents ( const Data text)

Definition at line 45 of file Pkcs7Contents.cxx.

   : Contents(getStaticType()),
     mText(txt)
{
}
Pkcs7Contents::Pkcs7Contents ( const HeaderFieldValue hfv,
const Mime contentType 
)

Definition at line 62 of file Pkcs7Contents.cxx.

   : Contents(hfv, contentsType),
     mText()
{
}
Pkcs7Contents::Pkcs7Contents ( const Data data,
const Mime contentType 
)

Definition at line 56 of file Pkcs7Contents.cxx.

   : Contents(contentsType),
     mText(txt)
{
}
Pkcs7Contents::Pkcs7Contents ( const Pkcs7Contents rhs)

Definition at line 73 of file Pkcs7Contents.cxx.

   : Contents(rhs),
     mText(rhs.mText)
{
}
Pkcs7Contents::~Pkcs7Contents ( ) [virtual]

Definition at line 84 of file Pkcs7Contents.cxx.

{
}

Member Function Documentation

Contents * Pkcs7Contents::clone ( ) const [virtual]

duplicate an Pkcs7Contents object

Returns:
pointer to a new Pkcs7Contents object

Implements resip::Contents.

Reimplemented in resip::Pkcs7SignedContents.

Definition at line 104 of file Pkcs7Contents.cxx.

References Pkcs7Contents().

{
   return new Pkcs7Contents(*this);
}

Here is the call graph for this function:

EncodeStream & Pkcs7Contents::encodeParsed ( EncodeStream str) const [virtual]

Implements resip::LazyParser.

Definition at line 131 of file Pkcs7Contents.cxx.

References mText.

{
   //DebugLog(<< "Pkcs7Contents::encodeParsed " << mText);
   str << mText;
   return str;
}
const Mime & Pkcs7Contents::getStaticType ( ) [static]

Reimplemented in resip::Pkcs7SignedContents.

Definition at line 116 of file Pkcs7Contents.cxx.

References type.

{
   static Mime type("application","pkcs7-mime");
   return type;
}
bool Pkcs7Contents::init ( ) [static]

Reimplemented from resip::Contents.

Reimplemented in resip::Pkcs7SignedContents.

Definition at line 20 of file Pkcs7Contents.cxx.

{
   static ContentsFactory<Pkcs7Contents> factory;
   (void)factory;
   return true;
}
Pkcs7Contents & Pkcs7Contents::operator= ( const Pkcs7Contents rhs)

Definition at line 93 of file Pkcs7Contents.cxx.

References mText.

{
   if (this != &rhs)
   {
      Contents::operator=(rhs);
      mText = rhs.mText;
   }
   return *this;
}
void Pkcs7Contents::parse ( ParseBuffer pb) [virtual]

Implements resip::LazyParser.

Definition at line 140 of file Pkcs7Contents.cxx.

References resip::Data::base64decode(), resip::ParseBuffer::data(), DebugLog, resip::Data::escaped(), InfoLog, mText, resip::Contents::mTransferEncoding, resip::ParseBuffer::position(), and resip::ParseBuffer::skipToEnd().

{
   const char* anchor = pb.position();
   pb.skipToEnd();
   pb.data(mText, anchor);

   if ( mTransferEncoding )
   {
      InfoLog( << "Transfer Encoding is " << mTransferEncoding->value() );
      if ( mTransferEncoding->value() == Data("base64") )
      {
         Data bin = mText.base64decode();
         mText = bin;
         InfoLog( << "Base64 decoded to " << mText.escaped() );
      }
   }
   
   DebugLog(<< "Pkcs7Contents::parsed <" << mText.escaped() << ">" );
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented in resip::Pkcs7SignedContents.

Definition at line 17 of file Pkcs7Contents.hxx.

Definition at line 42 of file Pkcs7Contents.hxx.

Referenced by encodeParsed(), operator=(), and parse().


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