10 #ifndef DAF_AUTH_STATE_H 11 #define DAF_AUTH_STATE_H 86 struct json_object *m_json;
90 struct json_object * encodeBytes(
const DAData &bytes);
95 bool decodeBytes(
const char *b64_cstr,
DAData &out);
98 void setString(
const char *key,
const char *val);
101 bool hasValue(
const char *key);
106 bool getString(
const char *key, std::string &out);
DAAuthState()
ctor with empty object.
Encapsulates a message and various (optional) crypto parameters.
Definition: DigitalAuthenticationFramework.h:369
Long term state for authglue library.
Definition: daf_auth_state.h:26
void setUserString(const std::string &us)
Save (opaque) data as the user string.
std::string marshal() const
Produce a string format of underlying JSON message.
bool unmarshal(const std::string &str)
Replace object by unmarshaling provided string, returning false if that string has invalid JSON encod...
DAAuthClass
Authentication device type.
Definition: daf_auth_identify.h:139
~DAAuthState()
dtor, freeing underlying message.
void setAuthClass(DAAuthClass cls)
Save the authentication class.
bool hasKeySerial()
Return true if we have a saved key serial number.
void operator=(const DAAuthState &other)
assignment by deep copy.
void setDAMessage(const DAMessage &msg)
Save the contents of the given DAMessage (all fields).
bool getKeySerial(std::string &ks_out)
Retrieve saved key serial number, returning false if there is no valid stored key serial number...
bool getUserString(std::string &us_out)
Retrieve data stored by above call.
bool getAuthClass(DAAuthClass &cls)
Get the stored authentication class, returning false if there is no valid stored class.
std::vector< uint8_t > DAData
A data block represented as a sequence of bytes.
Definition: DigitalAuthenticationFramework.h:28
bool getDAMessage(DAMessage &msg)
Retrieve saved DAMessage contents into msg, returning false if there is not one, or if it is invalid...
Identification of DAF device capabilities.
void setKeySerial(const std::string &ks)
Save the given key serial number.