Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cX509Crl.h
Go to the documentation of this file.
1 //
4 //
5 #ifndef _INC_cX509Crl_H
6 #define _INC_cX509Crl_H
7 #ifndef NO_PRAGMA_ONCE
8 #pragma once
9 #endif
10 
11 #include "cX509Common.h"
12 #include "cX509Reader.h"
13 #include "../File/cASNSequence.h"
14 
15 namespace GrayLib
16 {
17  class cX509Crt;
18 
20  {
24 
25  public:
28 
29  cX509CrlEntry* m_pNextEnt; // TODO Get rid of this? Make array.
30 
31  public:
32  cX509CrlEntry() noexcept
33  : m_pNextEnt(nullptr)
34  {
35  }
36 
37  ~cX509CrlEntry() noexcept
38  {
39  cMem::ZeroSecure(this, sizeof(*this));
40  }
41 
42  void FreeEntries() noexcept
43  {
44  cX509CrlEntry* pCur = this->m_pNextEnt;
45  m_pNextEnt = nullptr;
46 
47  while (pCur != nullptr)
48  {
49  cX509CrlEntry* pNext = pCur->m_pNextEnt;
50  delete pCur;
51  pCur = pNext;
52  }
53  }
54 
55  HRESULT ReadCrlEntries(cASNReader& r);
56  };
57 
59  {
64 
65  typedef cX509Common SUPER_t;
66 
67  public:
68  static const char* k_pszPEM; // "X509 CRL"
69 
72 
75 
77 
79 
80  protected:
81  void SetEmptyX1();
82 
83  public:
85  : m_pNextCrl(nullptr)
86  {
87  }
89  {
90  SetEmptyX();
91  }
92 
93  virtual void SetEmptyX() override;
94 
95  virtual HRESULT GetDescription(StrBuilder& s, const char* prefix = nullptr) const override;
96 
97  bool CheckSignatureParent(const cX509Crt* pCrtParent, X509_Verify_t& rFlags) const;
98  bool IsCrtRevoked(const cASNBuf& rSerialNumber) const;
99 
104  //
105  virtual HRESULT ReadFromDer1(const BYTE* pBuffer, size_t nSizeBuf) override;
106  virtual HRESULT ReadFromDER(const BYTE* pBuffer, size_t nSizeBuf) override;
107 
113  //
114  virtual HRESULT ReadFromUnk(const BYTE* pBuffer, size_t nSizeBuf) override;
115 
117  };
118 }
119 
120 #endif // _INC_cX509Crl_H
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cASN.h:184
Definition: cASN.h:78
Definition: cASNReader.h:22
Definition: cASNSets.h:58
Definition: cX509Common.h:24
Definition: cX509Crl.h:20
cTimeUnits m_revocation_date
Optional Invalidity Date.
Definition: cX509Crl.h:27
void FreeEntries() noexcept
Definition: cX509Crl.h:42
cASNBufAlloc m_SerialNumber
binary CertificateSerialNumber. 32 byte max RFC5280.
Definition: cX509Crl.h:26
~cX509CrlEntry() noexcept
Definition: cX509Crl.h:37
cX509CrlEntry * m_pNextEnt
Definition: cX509Crl.h:29
cX509CrlEntry() noexcept
Definition: cX509Crl.h:32
Definition: cX509Crl.h:59
UNITTEST_FRIEND(cX509Crl)
cASNSets m_issuer
The parsed issuer data (named information object).
Definition: cX509Crl.h:71
cTimeUnits m_tNextUpdate
OPTIONAL.
Definition: cX509Crl.h:74
cX509CrlEntry m_entry
The CRL entries containing the certificate revocation times for this CA.
Definition: cX509Crl.h:76
~cX509Crl()
Definition: cX509Crl.h:88
cASNBuf m_issuer_raw
For faster compares with CRT.
Definition: cX509Crl.h:70
static const char * k_pszPEM
Definition: cX509Crl.h:68
cX509Crl()
Definition: cX509Crl.h:84
cTimeUnits m_tThisUpdate
Definition: cX509Crl.h:73
cRefPtr< cX509Crl > m_pNextCrl
Definition: cX509Crl.h:78
Definition: cX509Crt.h:20
Definition: StrBuilder.h:18
Definition: cRefPtr.h:225
Definition: cTimeUnits.h:146
Definition: cMesh.h:22
X509_Verify_t
Definition: cX509.h:41
static void ZeroSecure(void *pData, size_t nSizeBlock) noexcept
Definition: cMem.h:110