]>
Commit | Line | Data |
---|---|---|
680f25f8 RK |
1 | #ifndef PDNS_PKCS11SIGNERS_HH |
2 | #define PDNS_PKCS11SIGNERS_HH | |
3 | ||
8daea594 AT |
4 | class PKCS11DNSCryptoKeyEngine : public DNSCryptoKeyEngine |
5 | { | |
6 | protected: | |
7 | std::string d_engine; | |
8 | unsigned long d_slot_id; | |
9 | std::string d_pin; | |
10 | std::string d_label; | |
11 | ||
12 | public: | |
13 | PKCS11DNSCryptoKeyEngine(unsigned int algorithm); | |
14 | ~PKCS11DNSCryptoKeyEngine(); | |
15 | ||
16 | bool operator<(const PKCS11DNSCryptoKeyEngine& rhs) const | |
17 | { | |
18 | return false; | |
19 | } | |
20 | PKCS11DNSCryptoKeyEngine(const PKCS11DNSCryptoKeyEngine& orig); | |
21 | ||
22 | string getName() const { return "P11 Kit PKCS#11"; }; | |
23 | ||
24 | void create(unsigned int bits); | |
25 | ||
26 | storvector_t convertToISCVector() const; | |
27 | ||
28 | std::string sign(const std::string& msg) const; | |
29 | ||
30 | std::string hash(const std::string& msg) const; | |
31 | ||
32 | bool verify(const std::string& msg, const std::string& signature) const; | |
33 | ||
34 | std::string getPubKeyHash() const; | |
35 | ||
36 | std::string getPublicKeyString() const; | |
37 | ||
38 | int getBits() const; | |
39 | ||
40 | void fromISCMap(DNSKEYRecordContent& drc, stormap_t& stormap) { | |
41 | drc.d_algorithm = atoi(stormap["algorithm"].c_str()); | |
42 | d_engine = stormap["engine"]; | |
43 | d_slot_id = atoi(stormap["slot"].c_str()); | |
44 | d_pin = stormap["pin"]; | |
45 | d_label = stormap["label"]; | |
46 | }; | |
47 | ||
48 | void fromPEMString(DNSKEYRecordContent& drc, const std::string& raw) { throw "Unimplemented"; }; | |
49 | void fromPublicKeyString(const std::string& content) { throw "Unimplemented"; }; | |
50 | ||
51 | static DNSCryptoKeyEngine* maker(unsigned int algorithm); | |
52 | }; | |
53 | ||
680f25f8 | 54 | #endif /* PDNS_PKCS11SIGNERS_HH */ |