26#ifndef GSS_TSIG_UTIL_H 
   27#define GSS_TSIG_UTIL_H 
   30#include <boost/noncopyable.hpp> 
   31#include <boost/shared_ptr.hpp> 
   32#include <gssapi/gssapi_krb5.h> 
   92std::string 
gssApiErrMsg(OM_uint32 major, OM_uint32 minor);
 
  114    explicit GssApiBuffer(
const std::vector<uint8_t>& content);
 
  130        return (buffer_.value == 0);
 
 
  144        return (buffer_.length);
 
 
  154        return (buffer_.value);
 
 
  172    std::string 
getString(
bool trim = 
false) 
const;
 
  176    gss_buffer_desc buffer_;
 
 
  195    explicit GssApiName(
const std::string& gname);
 
 
  255               OM_uint32& lifetime);
 
  275                 OM_uint32& lifetime);
 
 
  302    explicit GssApiSecCtx(
const std::vector<uint8_t>& 
import);
 
  346                 OM_uint32& flags, 
bool& local, 
bool& established);
 
  382              OM_uint32& lifetime);
 
  403    gss_ctx_id_t sec_ctx_;
 
 
  422    explicit GssApiOid(
const std::vector<uint8_t>& elements);
 
 
  489    gss_OID_set oid_set_;
 
 
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Exception(const char *file, size_t line, const char *what)
std::vector< uint8_t > getContent() const
Get the content as a vector.
bool empty() const
Empty predicate.
gss_buffer_t getPtr()
Get pointer.
void * getValue()
Get the value.
size_t getLength() const
Get the length.
std::string getString(bool trim=false) const
Get the content as a string.
~GssApiBuffer()
Destructor.
GssApiBuffer()
Constructor.
void inquire(GssApiName &name, gss_cred_usage_t &cred_usage, OM_uint32 &lifetime)
Inquire.
gss_cred_id_t get()
Get the value.
GssApiError(const char *file, size_t line, const char *what)
void setLastError(int error)
Set the last error.
int getLastError() const
Get the last error.
GssApiLastError()
Constructor.
virtual ~GssApiLastError()
Destructor.
gss_name_t * getPtr()
Get pointer.
std::string toString()
textual representation.
gss_name_t get()
Get the value.
bool compare(GssApiName &other)
Compare.
gss_OID_set get()
Get the value.
~GssApiOidSet()
Destructor.
GssApiOidSet(bool fill=true)
Constructor.
gss_OID get()
Get the value.
std::string toString()
Get textual representation.
gss_ctx_id_t get()
Get the value.
void sign(GssApiBuffer &gmessage, GssApiBuffer &gsig)
Sign.
bool init(GssApiCredPtr credp, GssApiName &target, OM_uint32 flags, GssApiBuffer &intoken, GssApiBuffer &outtoken, OM_uint32 &lifetime)
Init.
void verify(GssApiBuffer &gmessage, GssApiBuffer &gsig)
Verify.
~GssApiSecCtx()
Destructor.
std::vector< uint8_t > serialize()
Export.
OM_uint32 getLifetime()
Get the lifetime (validity in seconds).
gss_ctx_id_t * getPtr()
Get a pointer to the security context.
GssApiSecCtx(gss_ctx_id_t sec_ctx)
Constructor.
void inquire(GssApiName &source, GssApiName &target, OM_uint32 &lifetime, OM_uint32 &flags, bool &local, bool &established)
Inquire.
bool accept(GssApiCred &cred, GssApiBuffer &intoken, GssApiName &source, GssApiBuffer &outtoken)
Accept.
GssCredExpired(const char *file, size_t line, const char *what)
GssApiOid ISC_GSS_SPNEGO_MECHANISM(ISC_GSS_SPNEGO_MECHANISM_vect)
The SPNEGO OID.
boost::shared_ptr< GssApiName > GssApiNamePtr
Shared pointer to GSS-API name.
boost::shared_ptr< GssApiOid > GssApiOidPtr
Shared pointer to GSS-API OID.
string gssApiErrMsg(OM_uint32 major, OM_uint32 minor)
An the error message.
boost::shared_ptr< GssApiBuffer > GssApiBufferPtr
Shared pointer to GSS-API buffer.
boost::shared_ptr< GssApiOidSet > GssApiOidSetPtr
Shared pointer to GSS-API OID set.
GssApiOid ISC_GSS_KRB5_MECHANISM(ISC_GSS_KRB5_MECHANISM_vect)
The Kerberos 5 OID.
boost::shared_ptr< GssApiCred > GssApiCredPtr
Shared pointer to GSS-API credential.
Defines the logger used by the top-level component of kea-lfc.