forked from SideStore/SideServer-Windows
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCertificate.hpp
More file actions
executable file
·66 lines (49 loc) · 1.83 KB
/
Certificate.hpp
File metadata and controls
executable file
·66 lines (49 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// Certificate.hpp
// AltSign-Windows
//
// Created by Riley Testut on 8/12/19.
// Copyright © 2019 Riley Testut. All rights reserved.
//
#ifndef Certificate_hpp
#define Certificate_hpp
/* The classes below are exported */
#pragma GCC visibility push(default)
#include <string>
#include <vector>
#include <optional>
#include <plist/plist.h>
#include <cpprest/json.h>
class Certificate
{
public:
Certificate();
~Certificate();
Certificate(plist_t plist) /* throws */;
Certificate(web::json::value plist) /* throws */;
Certificate(std::vector<unsigned char>& data);
Certificate(std::vector<unsigned char>& p12Data, std::string password);
std::string name() const;
std::string serialNumber() const;
std::optional<std::string> identifier() const;
std::optional<std::string> machineName() const;
std::optional<std::string> machineIdentifier() const;
void setMachineIdentifier(std::optional<std::string> machineIdentifier);
std::optional<std::vector<unsigned char>> data() const;
std::optional<std::vector<unsigned char>> encryptedP12Data(std::string password) const;
std::optional<std::vector<unsigned char>> privateKey() const;
void setPrivateKey(std::optional<std::vector<unsigned char>> privateKey);
std::optional<std::vector<unsigned char>> p12Data() const;
friend std::ostream& operator<<(std::ostream& os, const Certificate& certificate);
private:
std::string _name;
std::string _serialNumber;
std::optional<std::string> _identifier;
std::optional<std::string> _machineName;
std::optional<std::string> _machineIdentifier;
std::optional<std::vector<unsigned char>> _data;
std::optional<std::vector<unsigned char>> _privateKey;
void ParseData(std::vector<unsigned char>& data);
};
#pragma GCC visibility pop
#endif /* Certificate_hpp */