SASC
DVBSoftCAM

cHexKey Class Reference

#include <system-common.h>

Inheritance diagram for cHexKey:

List of all members.

Public Member Functions

 cHexKey (bool Super)
virtual ~cHexKey ()
virtual bool Parse (const char *line)
 cHexKey (bool Super)
virtual ~cHexKey ()
virtual bool Parse (const char *line)

Protected Member Functions

virtual bool SetKey (void *Key, int Keylen)
virtual bool SetBinKey (unsigned char *Mem, int Keylen)
virtual cString Print (void)
virtual bool Cmp (cPlainKey *k)
virtual void Get (void *mem)
virtual int Size (void)
virtual bool SetKey (void *Key, int Keylen)
virtual bool SetBinKey (unsigned char *Mem, int Keylen)
virtual cString Print (void)
virtual bool Cmp (cPlainKey *k)
virtual void Get (void *mem)
virtual int Size (void)

Detailed Description

Definition at line 28 of file system-common.h.


Constructor & Destructor Documentation

cHexKey::cHexKey ( bool  Super)

Definition at line 34 of file system-common.c.

:cPlainKey(Super)
{
  key=0;
}
cHexKey::~cHexKey ( ) [virtual]

Definition at line 40 of file system-common.c.

References free.

{
  free(key);
}
cHexKey::cHexKey ( bool  Super)
virtual cHexKey::~cHexKey ( ) [virtual]

Member Function Documentation

bool cHexKey::Cmp ( cPlainKey *  k) [protected, virtual]

Implements cPlainKey.

Definition at line 58 of file system-common.c.

References k.

{
  cHexKey *hk=dynamic_cast<cHexKey *>(k); // downcast
  return hk && keylen==hk->keylen && memcmp(key,hk->key,keylen)==0;
}
virtual bool cHexKey::Cmp ( cPlainKey *  k) [protected, virtual]

Implements cPlainKey.

void cHexKey::Get ( void *  mem) [protected, virtual]

Implements cPlainKey.

Definition at line 64 of file system-common.c.

{
  memcpy(mem,key,keylen);
}
virtual void cHexKey::Get ( void *  mem) [protected, virtual]

Implements cPlainKey.

virtual bool cHexKey::Parse ( const char *  line) [inline, virtual]

Implements cPlainKey.

Reimplemented in cPlainKeyStd, cPlainKeyConstCw, cPlainKeyIrd, cPlainKeyVia, cPlainKeyStd, cPlainKeyConstCw, cPlainKeyIrd, and cPlainKeyVia.

Definition at line 42 of file system-common.h.

{ return false; }
virtual bool cHexKey::Parse ( const char *  line) [inline, virtual]

Implements cPlainKey.

Reimplemented in cPlainKeyStd, cPlainKeyConstCw, cPlainKeyIrd, cPlainKeyVia, cPlainKeyStd, cPlainKeyConstCw, cPlainKeyIrd, and cPlainKeyVia.

Definition at line 42 of file system-common.h.

{ return false; }
virtual cString cHexKey::Print ( void  ) [protected, virtual]

Implements cPlainKey.

cString cHexKey::Print ( void  ) [protected, virtual]

Implements cPlainKey.

Definition at line 69 of file system-common.c.

References HexStr().

{
  char *str=(char *)malloc(keylen*2+2);
  if(str) HexStr(str,key,keylen);
  return cString(str,true);
}
virtual bool cHexKey::SetBinKey ( unsigned char *  Mem,
int  Keylen 
) [protected, virtual]

Implements cPlainKey.

Reimplemented in cPlainKeyIrd, cPlainKeyVia, cPlainKeyIrd, and cPlainKeyVia.

bool cHexKey::SetBinKey ( unsigned char *  Mem,
int  Keylen 
) [protected, virtual]

Implements cPlainKey.

Reimplemented in cPlainKeyIrd, cPlainKeyVia, cPlainKeyIrd, and cPlainKeyVia.

Definition at line 53 of file system-common.c.

References SetKey().

Referenced by cPlainKeyConstCw::Parse(), and cPlainKeyStd::Parse().

{
  return SetKey(Mem,Keylen);
}
bool cHexKey::SetKey ( void *  Key,
int  Keylen 
) [protected, virtual]

Implements cPlainKey.

Reimplemented in cPlainKeyIrd, cPlainKeyVia, cPlainKeyIrd, and cPlainKeyVia.

Definition at line 45 of file system-common.c.

References free, and MALLOC.

Referenced by SetBinKey().

{
  keylen=Keylen;
  free(key); key=MALLOC(unsigned char,keylen);
  if(key) memcpy(key,Key,keylen);
  return key!=0;
}
virtual bool cHexKey::SetKey ( void *  Key,
int  Keylen 
) [protected, virtual]

Implements cPlainKey.

Reimplemented in cPlainKeyIrd, cPlainKeyVia, cPlainKeyIrd, and cPlainKeyVia.

virtual int cHexKey::Size ( void  ) [inline, protected, virtual]

Implements cPlainKey.

Definition at line 38 of file system-common.h.

{ return keylen; }
virtual int cHexKey::Size ( void  ) [inline, protected, virtual]

Implements cPlainKey.

Definition at line 38 of file system-common.h.

{ return keylen; }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines