Rudiments: /home/dmuse/temp/rudiments/include/rudiments/gss.h Source File

Rudiments

gss.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3
4 #ifndef RUDIMENTS_GSS_H
5 #define RUDIMENTS_GSS_H
6
7 #include <rudiments/private/gssincludes.h>
8
9 class RUDIMENTS_DLLSPEC gss {
10 public:
12 gss();
13
15 ~gss();
16
31 const char * const *getAvailableMechanisms();
32
35 static bool supported();
36
37 #include <rudiments/private/gss.h>
38 };
39
40
41 class RUDIMENTS_DLLSPEC gssmechanism {
42 public:
44 gssmechanism();
45
47 ~gssmechanism();
48
53 bool initialize(const char *str);
54
60 bool initialize(const void *oid);
61
63 void clear();
64
68 const char *getString();
69
74 const void *getObjectId();
75
76 #include <rudiments/private/gssmechanism.h>
77 };
78
79
80 class RUDIMENTS_DLLSPEC gsscredentials {
81 public:
83 gsscredentials();
84
86 ~gsscredentials();
87
90 bool setKeytab(const char *keytab);
91
94 const char *getKeytab();
95
100 void setDesiredLifetime(uint32_t desiredlifetime);
101
106 uint32_t getDesiredLifetime();
107
111 void addDesiredMechanism(gssmechanism *mech);
112
116 void removeDesiredMechanism(gssmechanism *mech);
117
122 bool inDesiredMechanisms(gssmechanism *mech);
123
127 void clearDesiredMechanisms();
128
132 uint64_t getDesiredMechanismCount();
133
137 gssmechanism *getDesiredMechanism(uint64_t index);
138
139
142 bool acquireForService(const char *name);
143
146 bool acquireForUser(const char *name);
147
148
151 bool acquired();
152
153
155 void close();
156
157
162 const char *getName();
163
169 uint32_t getActualLifetime();
170
175 bool inActualMechanisms(gssmechanism *mech);
176
182 uint64_t getActualMechanismCount();
183
189 gssmechanism *getActualMechanism(uint64_t index);
190
191
194 uint32_t getMajorStatus();
195
198 uint32_t getMinorStatus();
199
202 const char *getStatus();
203
206 const char *getGSSMajorStatus();
207
210 const char *getGSSMinorStatus();
211
214 const char *getMechanismMajorStatus();
215
218 const char *getMechanismMinorStatus();
219
220
224 const void *getCredentials();
225
226 #include <rudiments/private/gsscredentials.h>
227 };
228
229
230 class RUDIMENTS_DLLSPEC gsscontext : public securitycontext {
231 public:
233 gsscontext();
234
236 virtual ~gsscontext();
237
240 void setCredentials(gsscredentials *credentials);
241
244 gsscredentials *getCredentials();
245
259 void setFileDescriptor(filedescriptor *fd);
260
264 filedescriptor *getFileDescriptor();
265
270 void setDesiredLifetime(uint32_t desiredlifetime);
271
276 uint32_t getDesiredLifetime();
277
280 void setDesiredMechanism(gssmechanism *desiredmechanism);
281
285 gssmechanism *getDesiredMechanism();
286
289 void setDesiredFlags(uint32_t desiredflags);
290
293 void setDesiredFlags(const char *desiredflags);
294
297 uint32_t getDesiredFlags();
298
301 void setService(const char *service);
302
305 const char *getService();
306
307
318 bool connect();
319
320
331 bool accept();
332
333
340 uint32_t getActualLifetime();
341
346 gssmechanism *getActualMechanism();
347
352 uint32_t getActualFlags();
353
355 uint32_t getRemainingLifetime();
356
357
360 const char *getInitiator();
361
364 const char *getAcceptor();
365
366
369 bool getIsInitiator();
370
373 bool getIsOpen();
374
375
381 bool wrap(const unsigned char *input,
382 size_t inputsize,
383 unsigned char **output,
384 size_t *outputsize);
385
393 bool wrap(const unsigned char *input,
394 size_t inputsize,
395 bool useencryption,
396 unsigned char **output,
397 size_t *outputsize,
398 bool *encryptionused);
399
400
406 bool unwrap(const unsigned char *input,
407 size_t inputsize,
408 unsigned char **output,
409 size_t *outputsize);
410
417 bool unwrap(const unsigned char *input,
418 size_t inputsize,
419 unsigned char **output,
420 size_t *outputsize,
421 bool *decryptionused);
422
423
429 bool getMic(const unsigned char *message,
430 size_t messagesize,
431 unsigned char **mic,
432 size_t *micsize);
433
438 bool verifyMic(const unsigned char *message,
439 size_t messagesize,
440 const unsigned char *mic,
441 size_t micsize);
442
443
449 ssize_t read(void *buf, ssize_t size);
450
456 ssize_t write(const void *buf, ssize_t size);
457
460 ssize_t pending();
461
462
465 bool close();
466
467
470 ssize_t getSizeMax();
471
472
475 uint32_t getMajorStatus();
476
479 uint32_t getMinorStatus();
480
483 const char *getStatus();
484
487 const char *getGSSMajorStatus();
488
491 const char *getGSSMinorStatus();
492
495 const char *getMechanismMajorStatus();
496
499 const char *getMechanismMinorStatus();
500
501 #include <rudiments/private/gsscontext.h>
502 };
503
504 #endif
filedescriptor
Definition: filedescriptor.h:13
gss
Definition: gss.h:9
gss::~gss
~gss()
gss::getAvailableMechanisms
const char *const * getAvailableMechanisms()
gss::gss
gss()
gss::supported
static bool supported()
gsscontext
Definition: gss.h:230
gsscontext::write
ssize_t write(const void *buf, ssize_t size)
gsscontext::getStatus
const char * getStatus()
gsscontext::getService
const char * getService()
gsscontext::verifyMic
bool verifyMic(const unsigned char *message, size_t messagesize, const unsigned char *mic, size_t micsize)
gsscontext::getDesiredMechanism
gssmechanism * getDesiredMechanism()
gsscontext::getIsOpen
bool getIsOpen()
gsscontext::setDesiredFlags
void setDesiredFlags(uint32_t desiredflags)
gsscontext::wrap
bool wrap(const unsigned char *input, size_t inputsize, unsigned char **output, size_t *outputsize)
gsscontext::getGSSMinorStatus
const char * getGSSMinorStatus()
gsscontext::pending
ssize_t pending()
gsscontext::close
bool close()
gsscontext::connect
bool connect()
gsscontext::getFileDescriptor
filedescriptor * getFileDescriptor()
gsscontext::setDesiredMechanism
void setDesiredMechanism(gssmechanism *desiredmechanism)
gsscontext::getDesiredLifetime
uint32_t getDesiredLifetime()
gsscontext::getActualFlags
uint32_t getActualFlags()
gsscontext::getCredentials
gsscredentials * getCredentials()
gsscontext::setService
void setService(const char *service)
gsscontext::getSizeMax
ssize_t getSizeMax()
gsscontext::getMic
bool getMic(const unsigned char *message, size_t messagesize, unsigned char **mic, size_t *micsize)
gsscontext::getIsInitiator
bool getIsInitiator()
gsscontext::unwrap
bool unwrap(const unsigned char *input, size_t inputsize, unsigned char **output, size_t *outputsize)
gsscontext::~gsscontext
virtual ~gsscontext()
gsscontext::accept
bool accept()
gsscontext::getGSSMajorStatus
const char * getGSSMajorStatus()
gsscontext::setCredentials
void setCredentials(gsscredentials *credentials)
gsscontext::read
ssize_t read(void *buf, ssize_t size)
gsscontext::unwrap
bool unwrap(const unsigned char *input, size_t inputsize, unsigned char **output, size_t *outputsize, bool *decryptionused)
gsscontext::getDesiredFlags
uint32_t getDesiredFlags()
gsscontext::getRemainingLifetime
uint32_t getRemainingLifetime()
gsscontext::getInitiator
const char * getInitiator()
gsscontext::getMechanismMinorStatus
const char * getMechanismMinorStatus()
gsscontext::setDesiredLifetime
void setDesiredLifetime(uint32_t desiredlifetime)
gsscontext::getMechanismMajorStatus
const char * getMechanismMajorStatus()
gsscontext::setFileDescriptor
void setFileDescriptor(filedescriptor *fd)
gsscontext::gsscontext
gsscontext()
gsscontext::setDesiredFlags
void setDesiredFlags(const char *desiredflags)
gsscontext::getMinorStatus
uint32_t getMinorStatus()
gsscontext::getActualLifetime
uint32_t getActualLifetime()
gsscontext::getAcceptor
const char * getAcceptor()
gsscontext::getMajorStatus
uint32_t getMajorStatus()
gsscontext::wrap
bool wrap(const unsigned char *input, size_t inputsize, bool useencryption, unsigned char **output, size_t *outputsize, bool *encryptionused)
gsscontext::getActualMechanism
gssmechanism * getActualMechanism()
gsscredentials
Definition: gss.h:80
gsscredentials::acquireForService
bool acquireForService(const char *name)
gsscredentials::acquired
bool acquired()
gsscredentials::getActualLifetime
uint32_t getActualLifetime()
gsscredentials::getMechanismMinorStatus
const char * getMechanismMinorStatus()
gsscredentials::inDesiredMechanisms
bool inDesiredMechanisms(gssmechanism *mech)
gsscredentials::getKeytab
const char * getKeytab()
gsscredentials::removeDesiredMechanism
void removeDesiredMechanism(gssmechanism *mech)
gsscredentials::getDesiredMechanismCount
uint64_t getDesiredMechanismCount()
gsscredentials::~gsscredentials
~gsscredentials()
gsscredentials::getGSSMajorStatus
const char * getGSSMajorStatus()
gsscredentials::clearDesiredMechanisms
void clearDesiredMechanisms()
gsscredentials::addDesiredMechanism
void addDesiredMechanism(gssmechanism *mech)
gsscredentials::getCredentials
const void * getCredentials()
gsscredentials::getDesiredMechanism
gssmechanism * getDesiredMechanism(uint64_t index)
gsscredentials::acquireForUser
bool acquireForUser(const char *name)
gsscredentials::setDesiredLifetime
void setDesiredLifetime(uint32_t desiredlifetime)
gsscredentials::getName
const char * getName()
gsscredentials::inActualMechanisms
bool inActualMechanisms(gssmechanism *mech)
gsscredentials::close
void close()
gsscredentials::getMechanismMajorStatus
const char * getMechanismMajorStatus()
gsscredentials::getGSSMinorStatus
const char * getGSSMinorStatus()
gsscredentials::getActualMechanism
gssmechanism * getActualMechanism(uint64_t index)
gsscredentials::getDesiredLifetime
uint32_t getDesiredLifetime()
gsscredentials::getMajorStatus
uint32_t getMajorStatus()
gsscredentials::gsscredentials
gsscredentials()
gsscredentials::setKeytab
bool setKeytab(const char *keytab)
gsscredentials::getActualMechanismCount
uint64_t getActualMechanismCount()
gsscredentials::getStatus
const char * getStatus()
gsscredentials::getMinorStatus
uint32_t getMinorStatus()
gssmechanism
Definition: gss.h:41
gssmechanism::gssmechanism
gssmechanism()
gssmechanism::~gssmechanism
~gssmechanism()
gssmechanism::initialize
bool initialize(const char *str)
gssmechanism::initialize
bool initialize(const void *oid)
gssmechanism::clear
void clear()
gssmechanism::getObjectId
const void * getObjectId()
gssmechanism::getString
const char * getString()
input
Definition: input.h:9
output
Definition: output.h:9
securitycontext
Definition: security.h:16