Digital Authentication Framework 6.0.1.33

authglue.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2014 Good Technology Corporation. All rights reserved.
00003  */
00004 
00005 #ifndef DAF_AUTHGLUE_H
00006 #define DAF_AUTHGLUE_H
00007 
00008 #include "../daf/DigitalAuthenticationFramework.h"
00009 #include "daf_auth_state.h"
00010 
00059 class DAAuthProtocol
00060 {
00061 public:
00063   virtual ~DAAuthProtocol() {}
00064 
00066   virtual DAError &getLastError() =0;
00067 
00071   virtual bool requiresExistingPassphrase() const =0;
00072 
00075   virtual bool inputExistingPassphrase(const std::string &string) =0;
00076 
00080   virtual bool requiresNewPassphrase() const =0;
00081 
00084   virtual bool inputNewPassphrase(const std::string &string) =0;
00085 
00087   virtual bool finished() const =0;
00088 
00094   virtual bool getSecret(DAData &out) =0;
00095 
00101   virtual bool getNewSecret(DAData &out) =0;
00102 };
00103 
00104 /* All these return a heap-allocated DAAuthProtocol. The caller
00105  * must delete when done. */
00106 
00116 DAAuthProtocol * DAAuthEnroll(DADevice &device, DASession &sess, DAAuthState &state);
00117 
00128 DAAuthProtocol * DAAuthAuthenticate(DADevice &device, DASession &sess, DAAuthState &state);
00129 
00140 DAAuthProtocol * DAAuthChangePassphrase(DADevice &device, DASession &sess, DAAuthState &state);
00141 
00142 #endif
00143