2011-04-15 06:52:18 +00:00
|
|
|
/*! @file
|
|
|
|
|
|
|
|
@id $Id$
|
|
|
|
*/
|
|
|
|
// 1 2 3 4 5 6 7 8
|
|
|
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
|
|
|
|
|
|
|
#include <openssl-engine.hxx>
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
class TestEngine: virtual public openssl::Engine {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual const char* id() {
|
2013-11-06 12:24:52 +00:00
|
|
|
CRYPTOLOG("log");
|
2011-04-15 06:52:18 +00:00
|
|
|
return "TestEngine_ID";
|
|
|
|
}
|
|
|
|
virtual const char* name() {
|
2013-11-06 12:24:52 +00:00
|
|
|
CRYPTOLOG("log");
|
2011-04-15 06:52:18 +00:00
|
|
|
return "TestEngine_NAME";
|
|
|
|
}
|
2018-03-12 13:34:44 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class OtherTestEngine: virtual public openssl::Engine {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual const char* id() {
|
|
|
|
CRYPTOLOG("log");
|
|
|
|
return "OtherTestEngine_ID";
|
|
|
|
}
|
|
|
|
virtual const char* name() {
|
|
|
|
CRYPTOLOG("log");
|
|
|
|
return "OtherTestEngine_NAME";
|
|
|
|
}
|
|
|
|
|
2011-04-15 06:52:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int main(int, char**) {
|
2018-03-12 13:34:44 +00:00
|
|
|
openssl::RegisterEngine<> testEngine(new TestEngine);
|
|
|
|
openssl::RegisterEngine<> otherTestEngine(new OtherTestEngine);
|
2011-04-15 06:52:18 +00:00
|
|
|
|
2018-03-12 13:34:44 +00:00
|
|
|
for (openssl::Engine::iterator it; it; ++it) {
|
|
|
|
std::cout<<"Found Engine: "<<(*it).id()<<std::endl;
|
2011-04-15 06:52:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|