Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cASNSequence Class Reference

#include <cASNSequence.h>

Inheritance diagram for GrayLib::cASNSequence:
GrayLib::cASNBuf Gray::cMemBlock

Public Member Functions

 cASNSequence () noexcept
 
 ~cASNSequence ()
 
void SetEmptySeq ()
 
HRESULT GetDescriptionSeq (StrBuilder &s, const char *pszSep=nullptr, bool bTypeLabel=false, int iLevel=0) const
 
HRESULT ReadSequence1 (ASN_t nTagExpected, cASNReader &r)
 
HRESULT ReadSequence (ASN_t nTagExpected, cASNReader &r)
 
HRESULT WriteSequence (cASNWriterRev &w)
 
- Public Member Functions inherited from GrayLib::cASNBuf
 cASNBuf () noexcept
 
ASN_TYPE get_ASNType () const noexcept
 
bool isEmptyBuf () const
 
bool isSequence () const noexcept
 
bool isPrintable () const noexcept
 
bool IsEqualBuf (const cASNBuf &b) const
 
bool IsEqualStr (const void *pStr, size_t nSize) const
 
bool IsEqualStr (const cASNBuf &b) const
 
void SetEmptyBuf ()
 
bool get_Bool () const
 
int get_Int () const
 
HRESULT GetDescriptionStr (StrBuilder &s) const
 
 UNITTEST_FRIEND (cASN)
 
- Public Member Functions inherited from Gray::cMemBlock
 cMemBlock () noexcept
 
 cMemBlock (const void *pData, size_t nSize) noexcept
 
 cMemBlock (const cMemBlock &block) noexcept
 
 cMemBlock (const cMemBlock *pBlock) noexcept
 
size_t get_DataSize () const noexcept
 
void * get_Data () const noexcept
 
BYTE * get_DataBytes () const noexcept
 
char * get_DataA () const noexcept
 
 operator const BYTE * () const noexcept
 
bool isValidPtr () const noexcept
 
bool IsValidIndex (size_t i) const noexcept
 
bool IsValidIndex2 (size_t i) const noexcept
 
bool IsValidPtr (const void *p) const noexcept
 
bool IsValidPtr2 (const void *p) const noexcept
 
bool IsZeros () const noexcept
 
bool IsEqualData (const void *pData, size_t nSize) const noexcept
 
bool IsEqualData (const cMemBlock *pData) const noexcept
 
bool IsEqualData (const cMemBlock &data) const noexcept
 
BYTE * GetOffset (size_t nOffset) const
 
const void * get_DataEnd () const noexcept
 
void put_DataPtr (void *pStart) noexcept
 
void put_Size (size_t nSize) noexcept
 
void SetBlock (void *pData, size_t nSize) noexcept
 
void SetEmptyBlock () noexcept
 
void InitZeros () noexcept
 
StrLen_t ConvertToString (char *pszDst, StrLen_t iDstSizeMax) const
 

Public Attributes

cASNSequencem_pNextSeq
 The next peer entry in the sequence. More...
 
cASNSequencem_pChildSeq
 This item itself is a isSequence()/ASN_SEQUENCE. Store my children. More...
 
- Public Attributes inherited from GrayLib::cASNBuf
ASN_TYPE m_eASNTag
 ASN1 tag defines the data type, e.g. ASN_StringUTF8. ASN_TYPE byte mask. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gray::cMemBlock
static COMPARE_t __stdcall Compare (const void *pData1, size_t iLen1, const void *pData2, size_t iLen2)
 
- Static Public Attributes inherited from GrayLib::cASNBuf
static const char *const k_szTypeName [ASNF_MASK]
 
- Protected Attributes inherited from Gray::cMemBlock
size_t m_nSize
 size_t of m_pData in bytes. May be determined at runtime. More...
 
void * m_pData
 

Detailed Description

Generic Element in a ASN_SEQUENCE of ASN.1/DER items. Or might just be a normal cASNBuf object. Everything in ASM/DER file can be represented here. e.g. I can read the whole .ASN file as a cASNSequence. cASNBuf = Point at Buffer containing the given ASN.1 item. (Assume it points into static space or other/parent/external cASNBufAlloc) Children are always dynamic allocated. The head might not be.

Constructor & Destructor Documentation

◆ cASNSequence()

GrayLib::cASNSequence::cASNSequence ( )
inlinenoexcept

◆ ~cASNSequence()

GrayLib::cASNSequence::~cASNSequence ( )
inline

Member Function Documentation

◆ GetDescriptionSeq()

HRESULT GrayLib::cASNSequence::GetDescriptionSeq ( StrBuilder s,
const char *  pszSep = nullptr,
bool  bTypeLabel = false,
int  iLevel = 0 
) const

Get a list of names. Assuming each cASNBuf holds a isPrintable() string.

◆ ReadSequence()

HRESULT GrayLib::cASNSequence::ReadSequence ( ASN_t  nTagExpected,
cASNReader r 
)

Read some unknown ASN stuff as a Sequence til the end of the reader.

  • nTagExpected = ASN_Unknown

◆ ReadSequence1()

HRESULT GrayLib::cASNSequence::ReadSequence1 ( ASN_t  nTagExpected,
cASNReader r 
)

Read a single tag buffer in a sequence..

  • nTagExpected = ASN_Unknown

◆ SetEmptySeq()

void GrayLib::cASNSequence::SetEmptySeq ( )
inline

Don't free this but free all my peers. and my body.

◆ WriteSequence()

HRESULT GrayLib::cASNSequence::WriteSequence ( cASNWriterRev w)

Write some unknown ASN stuff as a Sequence. In reverse.

Member Data Documentation

◆ m_pChildSeq

cASNSequence* GrayLib::cASNSequence::m_pChildSeq

This item itself is a isSequence()/ASN_SEQUENCE. Store my children.

◆ m_pNextSeq

cASNSequence* GrayLib::cASNSequence::m_pNextSeq

The next peer entry in the sequence.


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