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

#include <cASN.h>

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

Public Member Functions

 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

ASN_TYPE m_eASNTag
 ASN1 tag defines the data type, e.g. ASN_StringUTF8. ASN_TYPE byte mask. More...
 

Static Public Attributes

static const char *const k_szTypeName [ASNF_MASK]
 

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)
 
- 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

Store a single value of a type ASN_TYPE. Similar to a variant. ASN.1 file format loaded into memory buffer. parse ASN.1 DER encoded data structures Type-length-value structure that allows for ASN1 using DER.

Note
do NOT assume we allocate this cMemBlock dynamically.

Constructor & Destructor Documentation

◆ cASNBuf()

GrayLib::cASNBuf::cASNBuf ( )
inlinenoexcept

Member Function Documentation

◆ get_ASNType()

ASN_TYPE GrayLib::cASNBuf::get_ASNType ( ) const
inlinenoexcept

Get the base type with bits masked off. ASN1 type, e.g. ASN_StringUTF8. ASN_TYPE byte mask.

◆ get_Bool()

bool GrayLib::cASNBuf::get_Bool ( ) const
inline

◆ get_Int()

int GrayLib::cASNBuf::get_Int ( ) const

◆ GetDescriptionStr()

HRESULT GrayLib::cASNBuf::GetDescriptionStr ( StrBuilder s) const

Make some text to represent the data. depends on ASN_TYPE.

Returns
S_OK = done, <0 = fail i could not render. S_FALSE = i rendered it and all children.

◆ isEmptyBuf()

bool GrayLib::cASNBuf::isEmptyBuf ( ) const
inline

◆ IsEqualBuf()

bool GrayLib::cASNBuf::IsEqualBuf ( const cASNBuf b) const
inline

is exactly the same?

◆ IsEqualStr() [1/2]

bool GrayLib::cASNBuf::IsEqualStr ( const cASNBuf b) const
inline

Compare two X.509 strings, case-insensitive, and allowing for some encoding variations (but not all).

Returns
true if equal, false otherwise.

◆ IsEqualStr() [2/2]

bool GrayLib::cASNBuf::IsEqualStr ( const void *  pStr,
size_t  nSize 
) const
inline
  • pStr = non terminated string.

◆ isPrintable()

bool GrayLib::cASNBuf::isPrintable ( ) const
inlinenoexcept

Is this a printable string?

◆ isSequence()

bool GrayLib::cASNBuf::isSequence ( ) const
inlinenoexcept

Does this contain sub objects?

◆ SetEmptyBuf()

void GrayLib::cASNBuf::SetEmptyBuf ( )
inline

◆ UNITTEST_FRIEND()

GrayLib::cASNBuf::UNITTEST_FRIEND ( cASN  )

Member Data Documentation

◆ k_szTypeName

const char *const GrayLib::cASNBuf::k_szTypeName
static

◆ m_eASNTag

ASN_TYPE GrayLib::cASNBuf::m_eASNTag

ASN1 tag defines the data type, e.g. ASN_StringUTF8. ASN_TYPE byte mask.


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