-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAsn1Cert.hpp
40 lines (34 loc) · 914 Bytes
/
Asn1Cert.hpp
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
//
// asn-1cert.hpp
// browser-cc
//
// Created by Nissassin Seventeen on 10/5/15.
// Copyright (c) 2015 Nissassin Seventeen. All rights reserved.
//
#ifndef asn_1cert_hpp
#define asn_1cert_hpp
#include <cstdint>
#include <vector>
#include "Exportable.hpp"
#include "ASN1.hpp"
#include "Asn1TBSCertificate.h"
#include "Asn1AlgorithmIdentifier.h"
#include "RSAPublicKey.h"
using namespace std;
using namespace asn1;
namespace rsa {
class Asn1Cert: Exportable {
public:
Asn1Cert(const vector<uint8_t> &vector, size_t offset = 0);
virtual size_t size() const;
virtual vector<uint8_t> toData() const;
const shared_ptr<RSAPublicKey>& getRsaPublicKey() const;
private:
vector<uint8_t> data;
shared_ptr<Asn1TBSCertificate> tbsCertificate;
shared_ptr<Asn1AlgorithmIdentifier> signatureAlgorithm;
ASN1::BitStringType signatureValue;
shared_ptr<RSAPublicKey> rsaPublicKey;
};
}
#endif /* asn_1cert_hpp */