reSIProcate/stack  9694
Public Types | Public Member Functions | Private Attributes
resip::SdpContents::Session::Encryption Class Reference

process k= (encryption key) line More...

#include <SdpContents.hxx>

Collaboration diagram for resip::SdpContents::Session::Encryption:
Collaboration graph
[legend]

List of all members.

Public Types

enum  KeyType {
  NoEncryption = 0, Prompt, Clear, Base64,
  UriKey
}

Public Member Functions

 Encryption (const KeyType &method, const Data &key)
 Encryption (const Encryption &rhs)
Encryptionoperator= (const Encryption &rhs)
void parse (ParseBuffer &pb)
EncodeStreamencode (EncodeStream &) const
const KeyTypegetMethod () const
const KeyTypemethod () const
KeyTypemethod ()
const DatagetKey () const
const Datakey () const
Datakey ()
 Encryption ()

Private Attributes

KeyType mMethod
Data mKey

Detailed Description

process k= (encryption key) line

Definition at line 547 of file SdpContents.hxx.


Member Enumeration Documentation

Enumerator:
NoEncryption 
Prompt 
Clear 
Base64 
UriKey 

Definition at line 550 of file SdpContents.hxx.


Constructor & Destructor Documentation

SdpContents::Session::Encryption::Encryption ( const KeyType method,
const Data key 
)

Definition at line 864 of file SdpContents.cxx.

   : mMethod(method),
     mKey(key)
{}
SdpContents::Session::Encryption::Encryption ( const Encryption rhs)

Definition at line 870 of file SdpContents.cxx.

   : mMethod(rhs.mMethod),
     mKey(rhs.mKey)
{}
SdpContents::Session::Encryption::Encryption ( )

Definition at line 859 of file SdpContents.cxx.


Member Function Documentation

EncodeStream & SdpContents::Session::Encryption::encode ( EncodeStream s) const

Definition at line 889 of file SdpContents.cxx.

References resip::Symbols::COLON, CRLF, and KeyTypes.

Referenced by resip::SdpContents::Session::Medium::encode().

{
   s << "k="
     << KeyTypes[mMethod];
   if (mMethod != Prompt)
   {
      s << Symbols::COLON[0] << mKey;
   }
   s << Symbols::CRLF;

   return s;
}
const Data& resip::SdpContents::Session::Encryption::getKey ( ) const [inline]

Definition at line 563 of file SdpContents.hxx.

References mKey.

{return mKey;}
const KeyType& resip::SdpContents::Session::Encryption::getMethod ( ) const [inline]

Definition at line 560 of file SdpContents.hxx.

References mMethod.

Referenced by resip::SdpContents::Session::Medium::encode().

{return mMethod;}
const Data& resip::SdpContents::Session::Encryption::key ( ) const [inline]

Definition at line 564 of file SdpContents.hxx.

References mKey.

{return mKey;}
Data& resip::SdpContents::Session::Encryption::key ( ) [inline]

Definition at line 565 of file SdpContents.hxx.

References mKey.

{return mKey;}
const KeyType& resip::SdpContents::Session::Encryption::method ( ) const [inline]

Definition at line 561 of file SdpContents.hxx.

References mMethod.

{return mMethod;}
KeyType& resip::SdpContents::Session::Encryption::method ( ) [inline]

Definition at line 562 of file SdpContents.hxx.

References mMethod.

{return mMethod;}
SdpContents::Session::Encryption & SdpContents::Session::Encryption::operator= ( const Encryption rhs)

Definition at line 876 of file SdpContents.cxx.

References mKey, and mMethod.

{
   if (this != &rhs)
   {
      mMethod = rhs.mMethod;
      mKey = rhs.mKey;
   }
   return *this;
}
void SdpContents::Session::Encryption::parse ( ParseBuffer pb)

Definition at line 903 of file SdpContents.cxx.

References resip::Symbols::COLON, resip::Symbols::CRLF, resip::ParseBuffer::data(), resip::ParseBuffer::eof(), resip::Symbols::EQUALS, KeyTypes, resip::ParseBuffer::reset(), resip::ParseBuffer::skipChar(), skipEol(), resip::ParseBuffer::skipToChar(), and resip::ParseBuffer::skipToOneOf().

Referenced by resip::SdpContents::Session::Medium::parse().

{
   pb.skipChar('k');
   const char* anchor = pb.skipChar(Symbols::EQUALS[0]);

   pb.skipToChar(Symbols::COLON[0]);
   if (!pb.eof())
   {
      Data p;
      pb.data(p, anchor);
      if (p == KeyTypes[Clear])
      {
         mMethod = Clear;
      }
      else if (p == KeyTypes[Base64])
      {
         mMethod = Base64;
      }
      else if (p == KeyTypes[UriKey])
      {
         mMethod = UriKey;
      }

      anchor = pb.skipChar(Symbols::COLON[0]);
      pb.skipToOneOf(Symbols::CRLF);
      pb.data(mKey, anchor);
   }
   else
   {
      pb.reset(anchor);
      pb.skipToOneOf(Symbols::CRLF);

      Data p;
      pb.data(p, anchor);
      if (p == KeyTypes[Prompt])
      {
         mMethod = Prompt;
      }
   }

   skipEol(pb);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 570 of file SdpContents.hxx.

Referenced by getKey(), key(), and operator=().

Definition at line 569 of file SdpContents.hxx.

Referenced by getMethod(), method(), and operator=().


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