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
12class RUDIMENTS_DLLSPEC gss : public object {
13 public:
15 gss();
16
19
34 const char * const *getAvailableMechanisms();
35
38 static bool isSupported();
39
40 #include <rudiments/private/gss.h>
41};
42
43
46class RUDIMENTS_DLLSPEC gssmechanism : public object {
47 public:
50
53
59 bool open(const char *str);
60
66 bool open(const void *oid);
67
71 const char *getString();
72
77 const void *getObjectId();
78
82 bool close();
83
84 #include <rudiments/private/gssmechanism.h>
85};
86
87
90class RUDIMENTS_DLLSPEC gsscredentials : public object {
91 public:
94
97
100 bool setKeytab(const char *keytab);
101
104 const char *getKeytab();
105
110 void setDesiredLifetime(uint32_t desiredlifetime);
111
117
122
127
133
138
143
148
149
152 bool acquireForService(const char *name);
153
156 bool acquireForUser(const char *name);
157
158
162
163
165 void close();
166
167
172 const char *getName();
173
180
186
193
200
201
204 uint32_t getMajorStatus();
205
208 uint32_t getMinorStatus();
209
212 const char *getStatus();
213
216 const char *getGSSMajorStatus();
217
220 const char *getGSSMinorStatus();
221
225
229
230
234 const void *getCredentials();
235
236 #include <rudiments/private/gsscredentials.h>
237};
238
239
242class RUDIMENTS_DLLSPEC gsscontext : public securitycontext {
243 public:
246
248 virtual ~gsscontext();
249
252 void setCredentials(gsscredentials *credentials);
253
257
272
277
282 void setDesiredLifetime(uint32_t desiredlifetime);
283
289
292 void setDesiredMechanism(gssmechanism *desiredmechanism);
293
298
301 void setDesiredFlags(uint32_t desiredflags);
302
305 void setDesiredFlags(const char *desiredflags);
306
309 uint32_t getDesiredFlags();
310
313 void setService(const char *service);
314
317 const char *getService();
318
319
330 bool connect();
331
332
343 bool accept();
344
345
353
359
364 uint32_t getActualFlags();
365
368
369
372 const char *getInitiator();
373
376 const char *getAcceptor();
377
378
382
385 bool isOpen();
386
387
393 bool wrap(const byte_t *input,
394 size_t inputsize,
395 byte_t **output,
396 size_t *outputsize);
397
405 bool wrap(const byte_t *input,
406 size_t inputsize,
407 bool useencryption,
408 byte_t **output,
409 size_t *outputsize,
410 bool *encryptionused);
411
412
418 bool unwrap(const byte_t *input,
419 size_t inputsize,
420 byte_t **output,
421 size_t *outputsize);
422
429 bool unwrap(const byte_t *input,
430 size_t inputsize,
431 byte_t **output,
432 size_t *outputsize,
433 bool *decryptionused);
434
435
441 bool getMic(const byte_t *message,
442 size_t messagesize,
443 byte_t **mic,
444 size_t *micsize);
445
450 bool verifyMic(const byte_t *message,
451 size_t messagesize,
452 const byte_t *mic,
453 size_t micsize);
454
455
461 ssize_t read(void *buf, size_t size);
462
468 ssize_t write(const void *buf, size_t size);
469
473
474
477 bool close();
478
479
482 size_t getSizeMax();
483
484
487 uint32_t getMajorStatus();
488
491 uint32_t getMinorStatus();
492
495 const char *getStatus();
496
499 const char *getGSSMajorStatus();
500
503 const char *getGSSMinorStatus();
504
508
512
513 #include <rudiments/private/gsscontext.h>
514};
515
516#endif
Definition filedescriptor.h:13
Definition gss.h:12
~gss()
const char *const * getAvailableMechanisms()
static bool isSupported()
Definition gss.h:242
bool isInitiator()
void setDesiredFlags(uint32_t desiredflags)
bool getMic(const byte_t *message, size_t messagesize, byte_t **mic, size_t *micsize)
bool verifyMic(const byte_t *message, size_t messagesize, const byte_t *mic, size_t micsize)
bool close()
bool connect()
void setDesiredMechanism(gssmechanism *desiredmechanism)
bool unwrap(const byte_t *input, size_t inputsize, byte_t **output, size_t *outputsize)
ssize_t write(const void *buf, size_t size)
uint32_t getDesiredLifetime()
bool wrap(const byte_t *input, size_t inputsize, bool useencryption, byte_t **output, size_t *outputsize, bool *encryptionused)
uint32_t getActualFlags()
void setService(const char *service)
filedescriptor * getFileDescriptor()
virtual ~gsscontext()
gssmechanism * getActualMechanism()
bool accept()
const char * getService()
void setCredentials(gsscredentials *credentials)
ssize_t read(void *buf, size_t size)
size_t getSizeMax()
const char * getGSSMajorStatus()
uint32_t getDesiredFlags()
uint32_t getRemainingLifetime()
const char * getAcceptor()
gsscredentials * getCredentials()
void setDesiredLifetime(uint32_t desiredlifetime)
const char * getStatus()
const char * getMechanismMinorStatus()
bool isOpen()
const char * getInitiator()
gssmechanism * getDesiredMechanism()
void setFileDescriptor(filedescriptor *fd)
const char * getGSSMinorStatus()
void setDesiredFlags(const char *desiredflags)
uint32_t getMinorStatus()
const char * getMechanismMajorStatus()
uint32_t getActualLifetime()
bool unwrap(const byte_t *input, size_t inputsize, byte_t **output, size_t *outputsize, bool *decryptionused)
uint32_t getMajorStatus()
bool wrap(const byte_t *input, size_t inputsize, byte_t **output, size_t *outputsize)
size_t getPendingSize()
Definition gss.h:90
bool acquireForService(const char *name)
const char * getGSSMinorStatus()
const char * getName()
uint32_t getActualLifetime()
const char * getStatus()
bool inDesiredMechanisms(gssmechanism *mech)
const void * getCredentials()
void removeDesiredMechanism(gssmechanism *mech)
uint64_t getDesiredMechanismCount()
void clearDesiredMechanisms()
gssmechanism * getDesiredMechanism(uint64_t index)
const char * getMechanismMajorStatus()
void addDesiredMechanism(gssmechanism *mech)
bool acquireForUser(const char *name)
const char * getGSSMajorStatus()
bool isInActualMechanisms(gssmechanism *mech)
const char * getMechanismMinorStatus()
void setDesiredLifetime(uint32_t desiredlifetime)
const char * getKeytab()
uint32_t getDesiredLifetime()
uint32_t getMajorStatus()
bool setKeytab(const char *keytab)
gssmechanism * getActualMechanism(uint64_t index)
uint64_t getActualMechanismCount()
bool getAreAcquired()
uint32_t getMinorStatus()
Definition gss.h:46
const void * getObjectId()
bool open(const char *str)
bool open(const void *oid)
const char * getString()
Definition input.h:11
Definition object.h:10
Definition output.h:11
Definition securitycontext.h:11