]>
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: | |
806d64bd | 7 | std::string d_module; |
248d701f | 8 | std::string d_slot_id; |
8daea594 AT |
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; | |
8daea594 AT |
37 | int getBits() const; |
38 | ||
3a3ecb9d | 39 | void fromISCMap(DNSKEYRecordContent& drc, stormap_t& stormap); |
8daea594 AT |
40 | |
41 | void fromPEMString(DNSKEYRecordContent& drc, const std::string& raw) { throw "Unimplemented"; }; | |
42 | void fromPublicKeyString(const std::string& content) { throw "Unimplemented"; }; | |
43 | ||
44 | static DNSCryptoKeyEngine* maker(unsigned int algorithm); | |
45 | }; | |
46 | ||
248d701f | 47 | bool PKCS11ModuleSlotLogin(const std::string& module, const string& tokenId, const std::string& pin); |
24e0b305 | 48 | |
680f25f8 | 49 | #endif /* PDNS_PKCS11SIGNERS_HH */ |