39 struct SpcPeImageData {
44 struct SpcSpOpusInfo {
45 std::string program_name;
46 std::string more_info;
54 using attributes_t = std::vector<std::unique_ptr<Attribute>>;
55 using signer_infos_t = std::vector<SignerInfo>;
56 using x509_certificates_t = std::vector<x509>;
57 using time_t = std::array<int32_t, 6>;
58 static result<Signature>
parse(std::vector<uint8_t> data,
bool skip_header =
false);
61 static result<Signature>
parse(BinaryStream& stream,
bool skip_header =
false);
64 static result<Signature>
parse(
const std::string& path);
68 SignatureParser&
operator=(
const SignatureParser&) =
delete;
71 ~SignatureParser() =
default;
72 SignatureParser() =
default;
74 static result<Signature> parse_signature(BinaryStream& stream);
76 static result<ContentInfo> parse_content_info(BinaryStream& stream, range_t& range);
77 static result<x509_certificates_t> parse_certificates(BinaryStream& stream);
78 static result<signer_infos_t> parse_signer_infos(BinaryStream& stream);
79 static result<attributes_t> parse_attributes(BinaryStream& stream);
80 static result<std::unique_ptr<Attribute>> parse_content_type(BinaryStream& stream);
82 static result<signer_infos_t> parse_pkcs9_counter_sign(BinaryStream& stream);
83 static result<std::vector<uint8_t>> parse_pkcs9_message_digest(BinaryStream& stream);
84 static result<int32_t> parse_pkcs9_at_sequence_number(BinaryStream& stream);
85 static result<time_t> parse_pkcs9_signing_time(BinaryStream& stream);
86 static result<std::unique_ptr<PKCS9TSTInfo>> parse_pkcs9_tstinfo(BinaryStream& stream);
88 static result<std::unique_ptr<Attribute>> parse_ms_counter_sign(BinaryStream& stream);
89 static result<Signature> parse_ms_spc_nested_signature(BinaryStream& stream);
90 static result<oid_t> parse_ms_spc_statement_type(BinaryStream& stream);
91 static result<SpcSpOpusInfo> parse_spc_sp_opus_info(BinaryStream& stream);
92 static result<std::string> parse_spc_string(BinaryStream& stream);
93 static result<std::string> parse_spc_link(BinaryStream& stream);
94 static result<std::unique_ptr<Attribute>> parse_spc_relaxed_pe_marker_check(BinaryStream& stream);
95 static result<SpcPeImageData> parse_spc_pe_image_data(BinaryStream& stream);
96 static result<std::unique_ptr<SpcIndirectData>> parse_spc_indirect_data(BinaryStream& stream, range_t& range);
97 static result<std::unique_ptr<Attribute>> parse_ms_platform_manifest_binary_id(BinaryStream& stream);
99 static result<std::unique_ptr<Attribute>> parse_signing_certificate_v2(BinaryStream& stream);