5 #include <glog/logging.h>
13 add_secret(srs_secret
);
16 SRS::~SRS() { srs_free(srs_
); }
18 std::string
SRS::forward(char const* sender
, char const* alias
) const
22 char buf
[1024]; // will be of size at most strlen(sender) + strlen(alias) + 64
23 CHECK_EQ(srs_forward(srs_
, buf
, sizeof(buf
), sender
, alias
), SRS_SUCCESS
);
24 return std::string(buf
);
27 std::string
SRS::reverse(char const* sender
) const
31 char buf
[1024]; // no longer than sender
32 CHECK_EQ(srs_reverse(srs_
, buf
, sizeof(buf
), sender
), SRS_SUCCESS
)
33 << "sender == " << sender
;
34 return std::string(buf
);
37 void SRS::add_secret(char const* secret
) { srs_add_secret(srs_
, secret
); }