Rudiments

- Main Page
- Classes

gss.h
1 // Copyright (c) 2015 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 supportsGSS();
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 count);
450
456 ssize_t write(const void *buf, ssize_t count);
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
gsscontext
Definition: gss.h:230
gsscredentials
Definition: gss.h:80
filedescriptor
Definition: filedescriptor.h:14
securitycontext
Definition: security.h:16
gssmechanism
Definition: gss.h:41
gss
Definition: gss.h:9