retdec
certificate_table.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_FILEFORMAT_TYPES_CERTIFICATE_TABLE_CERTIFICATE_TABLE_H
8 #define RETDEC_FILEFORMAT_TYPES_CERTIFICATE_TABLE_CERTIFICATE_TABLE_H
9 
10 #include <vector>
11 
13 
14 namespace retdec {
15 namespace fileformat {
16 
21 {
22  private:
23  using certificatesIterator = std::vector<Certificate>::const_iterator;
25  bool hasSigner = false;
27  bool hasCounterSigner = false;
29  std::size_t signerIndex = 0;
31  std::size_t counterSignerIndex = 0;
33  std::vector<Certificate> certificates;
34  public:
37  std::size_t getNumberOfCertificates() const;
38  std::size_t getSignerCertificateIndex() const;
39  std::size_t getCounterSignerCertificateIndex() const;
40  const Certificate* getCertificate(std::size_t certIndex) const;
42 
45  void setSignerCertificateIndex(std::size_t certIndex);
46  void setCounterSignerCertificateIndex(std::size_t certIndex);
48 
52  certificatesIterator end() const;
54 
57  bool hasSignerCertificate() const;
58  bool hasCounterSignerCertificate() const;
59  void addCertificate(const Certificate &certificate);
60  bool empty() const;
62 };
63 
64 } // namespace fileformat
65 } // namespace retdec
66 
67 #endif
Class for one certificate.
Definition: certificate_table.h:21
std::size_t getSignerCertificateIndex() const
Definition: certificate_table.cpp:25
std::vector< Certificate >::const_iterator certificatesIterator
Definition: certificate_table.h:23
bool hasSignerCertificate() const
Definition: certificate_table.cpp:102
bool hasSigner
flag indicating whether signer is present
Definition: certificate_table.h:25
void addCertificate(const Certificate &certificate)
Definition: certificate_table.cpp:120
bool hasCounterSigner
flag indicating whether counter signer is present
Definition: certificate_table.h:27
bool hasCounterSignerCertificate() const
Definition: certificate_table.cpp:111
void setCounterSignerCertificateIndex(std::size_t certIndex)
Definition: certificate_table.cpp:69
const Certificate * getCertificate(std::size_t certIndex) const
Definition: certificate_table.cpp:45
std::vector< Certificate > certificates
stored certificates
Definition: certificate_table.h:33
void setSignerCertificateIndex(std::size_t certIndex)
Definition: certificate_table.cpp:54
certificatesIterator begin() const
Definition: certificate_table.cpp:84
std::size_t getNumberOfCertificates() const
Definition: certificate_table.cpp:16
bool empty() const
Definition: certificate_table.cpp:129
std::size_t getCounterSignerCertificateIndex() const
Definition: certificate_table.cpp:35
std::size_t counterSignerIndex
index of certificate of the counter-signer
Definition: certificate_table.h:31
certificatesIterator end() const
Definition: certificate_table.cpp:93
std::size_t signerIndex
index of certificate of the signer
Definition: certificate_table.h:29
Definition: certificate.h:19
Definition: archive_wrapper.h:19