2023-02-27 05:23:25 +08:00
|
|
|
#pragma once
|
2022-08-29 14:23:38 +08:00
|
|
|
|
|
|
|
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
|
|
|
|
|
|
|
|
#include "../kaitai/kaitaistruct.h"
|
|
|
|
#include <stdint.h>
|
2023-02-27 05:23:25 +08:00
|
|
|
#include <memory>
|
2022-08-29 14:23:38 +08:00
|
|
|
|
|
|
|
#if KAITAI_STRUCT_VERSION < 9000L
|
|
|
|
#error "Incompatible Kaitai Struct C++/STL API: version 0.9 or later is required"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class intel_keym_v1_t : public kaitai::kstruct {
|
|
|
|
|
|
|
|
public:
|
|
|
|
class km_hash_t;
|
|
|
|
class public_key_t;
|
|
|
|
class signature_t;
|
|
|
|
class key_signature_t;
|
|
|
|
|
2023-02-04 15:53:10 +08:00
|
|
|
enum structure_ids_t : uint64_t {
|
2022-08-29 14:23:38 +08:00
|
|
|
STRUCTURE_IDS_KEYM = 6872296602200661855LL
|
|
|
|
};
|
|
|
|
|
2023-02-27 05:23:25 +08:00
|
|
|
intel_keym_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
2022-08-29 14:23:38 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void _read();
|
|
|
|
void _clean_up();
|
|
|
|
|
|
|
|
public:
|
|
|
|
~intel_keym_v1_t();
|
|
|
|
|
|
|
|
class km_hash_t : public kaitai::kstruct {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2023-02-27 05:23:25 +08:00
|
|
|
km_hash_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
2022-08-29 14:23:38 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void _read();
|
|
|
|
void _clean_up();
|
|
|
|
|
|
|
|
public:
|
|
|
|
~km_hash_t();
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint16_t m_hash_algorithm_id;
|
|
|
|
uint16_t m_len_hash;
|
|
|
|
std::string m_hash;
|
|
|
|
intel_keym_v1_t* m__root;
|
|
|
|
intel_keym_v1_t* m__parent;
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint16_t hash_algorithm_id() const { return m_hash_algorithm_id; }
|
|
|
|
uint16_t len_hash() const { return m_len_hash; }
|
|
|
|
std::string hash() const { return m_hash; }
|
|
|
|
intel_keym_v1_t* _root() const { return m__root; }
|
|
|
|
intel_keym_v1_t* _parent() const { return m__parent; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class public_key_t : public kaitai::kstruct {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2023-02-27 05:23:25 +08:00
|
|
|
public_key_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
2022-08-29 14:23:38 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void _read();
|
|
|
|
void _clean_up();
|
|
|
|
|
|
|
|
public:
|
|
|
|
~public_key_t();
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t m_version;
|
|
|
|
uint16_t m_size_bits;
|
|
|
|
uint32_t m_exponent;
|
|
|
|
std::string m_modulus;
|
|
|
|
intel_keym_v1_t* m__root;
|
|
|
|
intel_keym_v1_t::key_signature_t* m__parent;
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint8_t version() const { return m_version; }
|
|
|
|
uint16_t size_bits() const { return m_size_bits; }
|
|
|
|
uint32_t exponent() const { return m_exponent; }
|
|
|
|
std::string modulus() const { return m_modulus; }
|
|
|
|
intel_keym_v1_t* _root() const { return m__root; }
|
|
|
|
intel_keym_v1_t::key_signature_t* _parent() const { return m__parent; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class signature_t : public kaitai::kstruct {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2023-02-27 05:23:25 +08:00
|
|
|
signature_t(kaitai::kstream* p__io, intel_keym_v1_t::key_signature_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
2022-08-29 14:23:38 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void _read();
|
|
|
|
void _clean_up();
|
|
|
|
|
|
|
|
public:
|
|
|
|
~signature_t();
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t m_version;
|
|
|
|
uint16_t m_size_bits;
|
|
|
|
uint16_t m_hash_algorithm_id;
|
|
|
|
std::string m_signature;
|
|
|
|
intel_keym_v1_t* m__root;
|
|
|
|
intel_keym_v1_t::key_signature_t* m__parent;
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint8_t version() const { return m_version; }
|
|
|
|
uint16_t size_bits() const { return m_size_bits; }
|
|
|
|
uint16_t hash_algorithm_id() const { return m_hash_algorithm_id; }
|
|
|
|
std::string signature() const { return m_signature; }
|
|
|
|
intel_keym_v1_t* _root() const { return m__root; }
|
|
|
|
intel_keym_v1_t::key_signature_t* _parent() const { return m__parent; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class key_signature_t : public kaitai::kstruct {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2023-02-27 05:23:25 +08:00
|
|
|
key_signature_t(kaitai::kstream* p__io, intel_keym_v1_t* p__parent = nullptr, intel_keym_v1_t* p__root = nullptr);
|
2022-08-29 14:23:38 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
void _read();
|
|
|
|
void _clean_up();
|
|
|
|
|
|
|
|
public:
|
|
|
|
~key_signature_t();
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t m_version;
|
|
|
|
uint16_t m_key_id;
|
2023-02-27 05:23:25 +08:00
|
|
|
std::unique_ptr<public_key_t> m_public_key;
|
2022-08-29 14:23:38 +08:00
|
|
|
uint16_t m_sig_scheme;
|
2023-02-27 05:23:25 +08:00
|
|
|
std::unique_ptr<signature_t> m_signature;
|
2022-08-29 14:23:38 +08:00
|
|
|
intel_keym_v1_t* m__root;
|
|
|
|
intel_keym_v1_t* m__parent;
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint8_t version() const { return m_version; }
|
|
|
|
uint16_t key_id() const { return m_key_id; }
|
2023-02-27 05:23:25 +08:00
|
|
|
public_key_t* public_key() const { return m_public_key.get(); }
|
2022-08-29 14:23:38 +08:00
|
|
|
uint16_t sig_scheme() const { return m_sig_scheme; }
|
2023-02-27 05:23:25 +08:00
|
|
|
signature_t* signature() const { return m_signature.get(); }
|
2022-08-29 14:23:38 +08:00
|
|
|
intel_keym_v1_t* _root() const { return m__root; }
|
|
|
|
intel_keym_v1_t* _parent() const { return m__parent; }
|
|
|
|
};
|
|
|
|
|
|
|
|
private:
|
|
|
|
structure_ids_t m_structure_id;
|
|
|
|
uint8_t m_version;
|
|
|
|
uint8_t m_km_version;
|
|
|
|
uint8_t m_km_svn;
|
|
|
|
uint8_t m_km_id;
|
2023-02-27 05:23:25 +08:00
|
|
|
std::unique_ptr<km_hash_t> m_km_hash;
|
|
|
|
std::unique_ptr<key_signature_t> m_key_signature;
|
2022-08-29 14:23:38 +08:00
|
|
|
intel_keym_v1_t* m__root;
|
|
|
|
kaitai::kstruct* m__parent;
|
|
|
|
|
|
|
|
public:
|
|
|
|
structure_ids_t structure_id() const { return m_structure_id; }
|
|
|
|
uint8_t version() const { return m_version; }
|
|
|
|
uint8_t km_version() const { return m_km_version; }
|
|
|
|
uint8_t km_svn() const { return m_km_svn; }
|
|
|
|
uint8_t km_id() const { return m_km_id; }
|
2023-02-27 05:23:25 +08:00
|
|
|
km_hash_t* km_hash() const { return m_km_hash.get(); }
|
|
|
|
key_signature_t* key_signature() const { return m_key_signature.get(); }
|
2022-08-29 14:23:38 +08:00
|
|
|
intel_keym_v1_t* _root() const { return m__root; }
|
|
|
|
kaitai::kstruct* _parent() const { return m__parent; }
|
|
|
|
};
|