/*! @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() {
      CRYPTOLOG("log");
      return "TestEngine_ID";
    }
    virtual const char* name() {
      CRYPTOLOG("log");
      return "TestEngine_NAME";
    }

};

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";
    }

};

int main(int, char**) {
  openssl::RegisterEngine<> testEngine(new TestEngine);
  openssl::RegisterEngine<> otherTestEngine(new OtherTestEngine);
    
  for (openssl::Engine::iterator it; it; ++it) {
    std::cout<<"Found Engine: "<<(*it).id()<<std::endl;
  }
  
  return 0;
}
