blackberry.com
BlackBerry Dynamics
Runtime library for iOS applications
from the application developer portal

GDKerberosAuthHandler.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2017 BlackBerry Limited. All rights reserved.
00003  *
00004  */
00005 
00006 #ifndef GD_KRB_API_GDKERBEROSAUTHHANDLER_H_
00007 #define GD_KRB_API_GDKERBEROSAUTHHANDLER_H_
00008 
00009 #include <stdint.h>
00010 #if defined(__APPLE__)
00011 #include "TargetConditionals.h"
00012 #endif
00013 
00014 # define GD_ATTRIBUTE __attribute__
00015 
00016 namespace GD
00017 {
00018 
00019 namespace KRB_API
00020 {
00021     
00022 enum class Krb5ErrorCode : int32_t; // see definitions further.
00023 
00037 class GD_ATTRIBUTE((visibility("default"))) GDKerberosAuthHandler  /* final */
00038 {
00039     
00040 public:
00045     GDKerberosAuthHandler();
00046     ~GDKerberosAuthHandler();
00047     
00048 public:
00049 
00064     static bool getAllowDelegation();
00065     
00101     static void setAllowDelegation(bool allow);
00102     
00109     static void clearCache();
00110     
00145     Krb5ErrorCode setUpKerberosTicket(const char* username,
00146                                       const char* password,
00147                                       bool allowDelegation);
00148 
00166     Krb5ErrorCode setUpKerberosTicket(const char* username,
00167                                       const char* password);
00168     
00192     Krb5ErrorCode setUpKerberosTicket(bool allowDelegation);
00193     
00227     Krb5ErrorCode setUpKerberosTicket(const char* host,
00228                                       int port,
00229                                       bool allowDelegation);
00230 
00247     Krb5ErrorCode setUpKerberosTicket(const char* host, int port);
00248 
00264     bool implicitCredentialsAllowed();
00265 
00266 private:
00267     void *authKerberos;
00268 };
00269 
00288 enum class Krb5ErrorCode
00289 {
00290     KDC_ERR_NONE = -1765328384,
00291     KDC_ERR_NAME_EXP = -1765328383,
00292     KDC_ERR_SERVICE_EXP = -1765328382,
00293     KDC_ERR_BAD_PVNO = -1765328381,
00294     KDC_ERR_C_OLD_MAST_KVNO = -1765328380,
00295     KDC_ERR_S_OLD_MAST_KVNO = -1765328379,
00296     KDC_ERR_C_PRINCIPAL_UNKNOWN = -1765328378,
00297     KDC_ERR_S_PRINCIPAL_UNKNOWN = -1765328377,
00298     KDC_ERR_PRINCIPAL_NOT_UNIQUE = -1765328376,
00299     KDC_ERR_NULL_KEY = -1765328375,
00300     KDC_ERR_CANNOT_POSTDATE = -1765328374,
00301     KDC_ERR_NEVER_VALID = -1765328373,
00302     KDC_ERR_POLICY = -1765328372,
00303     KDC_ERR_BADOPTION = -1765328371,
00304     KDC_ERR_ETYPE_NOSUPP = -1765328370,
00305     KDC_ERR_SUMTYPE_NOSUPP = -1765328369,
00306     KDC_ERR_PADATA_TYPE_NOSUPP = -1765328368,
00307     KDC_ERR_TRTYPE_NOSUPP = -1765328367,
00308     KDC_ERR_CLIENT_REVOKED = -1765328366,
00309     KDC_ERR_SERVICE_REVOKED = -1765328365,
00310     KDC_ERR_TGT_REVOKED = -1765328364,
00311     KDC_ERR_CLIENT_NOTYET = -1765328363,
00312     KDC_ERR_SERVICE_NOTYET = -1765328362,
00313     KDC_ERR_KEY_EXPIRED = -1765328361,
00314     KDC_ERR_PREAUTH_FAILED = -1765328360,
00315     KDC_ERR_PREAUTH_REQUIRED = -1765328359,
00316     KDC_ERR_SERVER_NOMATCH = -1765328358,
00317     KDC_ERR_KDC_ERR_MUST_USE_USER2USER = -1765328357,
00318     KDC_ERR_PATH_NOT_ACCEPTED = -1765328356,
00319     KDC_ERR_SVC_UNAVAILABLE = -1765328355,
00320     KRB_AP_ERR_BAD_INTEGRITY = -1765328353,
00321     KRB_AP_ERR_TKT_EXPIRED = -1765328352,
00322     KRB_AP_ERR_TKT_NYV = -1765328351,
00323     KRB_AP_ERR_REPEAT = -1765328350,
00324     KRB_AP_ERR_NOT_US = -1765328349,
00325     KRB_AP_ERR_BADMATCH = -1765328348,
00326     KRB_AP_ERR_SKEW = -1765328347,
00327     KRB_AP_ERR_BADADDR = -1765328346,
00328     KRB_AP_ERR_BADVERSION = -1765328345,
00329     KRB_AP_ERR_MSG_TYPE = -1765328344,
00330     KRB_AP_ERR_MODIFIED = -1765328343,
00331     KRB_AP_ERR_BADORDER = -1765328342,
00332     KRB_AP_ERR_ILL_CR_TKT = -1765328341,
00333     KRB_AP_ERR_BADKEYVER = -1765328340,
00334     KRB_AP_ERR_NOKEY = -1765328339,
00335     KRB_AP_ERR_MUT_FAIL = -1765328338,
00336     KRB_AP_ERR_BADDIRECTION = -1765328337,
00337     KRB_AP_ERR_METHOD = -1765328336,
00338     KRB_AP_ERR_BADSEQ = -1765328335,
00339     KRB_AP_ERR_INAPP_CKSUM = -1765328334,
00340     KRB_AP_PATH_NOT_ACCEPTED = -1765328333,
00341     KRB_ERR_RESPONSE_TOO_BIG = -1765328332,
00342     KRB_ERR_GENERIC = -1765328324,
00343     KRB_ERR_FIELD_TOOLONG = -1765328323,
00344     KDC_ERR_CLIENT_NOT_TRUSTED = -1765328322,
00345     KDC_ERR_KDC_NOT_TRUSTED = -1765328321,
00346     KDC_ERR_INVALID_SIG = -1765328320,
00347     KDC_ERR_DH_KEY_PARAMETERS_NOT_ACCEPTED = -1765328319,
00348     KDC_ERR_WRONG_REALM = -1765328316,
00349     AP_ERR_USER_TO_USER_REQUIRED = -1765328315,
00350     KDC_ERR_CANT_VERIFY_CERTIFICATE = -1765328314,
00351     KDC_ERR_INVALID_CERTIFICATE = -1765328313,
00352     KDC_ERR_REVOKED_CERTIFICATE = -1765328312,
00353     KDC_ERR_REVOCATION_STATUS_UNKNOWN = -1765328311,
00354     KDC_ERR_REVOCATION_STATUS_UNAVAILABLE = -1765328310,
00355     KDC_ERR_CLIENT_NAME_MISMATCH = -1765328309,
00356     KDC_ERR_INCONSISTENT_KEY_PURPOSE = -1765328308,
00357     KDC_ERR_DIGEST_IN_CERT_NOT_ACCEPTED = -1765328307,
00358     KDC_ERR_PA_CHECKSUM_MUST_BE_INCLUDED = -1765328306,
00359     KDC_ERR_DIGEST_IN_SIGNED_DATA_NOT_ACCEPTED = -1765328305,
00360     KDC_ERR_PUBLIC_KEY_ENCRYPTION_NOT_SUPPORTED = -1765328304,
00361     KDC_ERR_INVALID_HASH_ALG = -1765328290,
00362     KDC_ERR_INVALID_ITERATION_COUNT = -1765328289,
00363     ERR_RCSID = -1765328256,
00364     LIBOS_BADLOCKFLAG = -1765328255,
00365     LIBOS_CANTREADPWD = -1765328254,
00366     LIBOS_BADPWDMATCH = -1765328253,
00367     LIBOS_PWDINTR = -1765328252,
00368     PARSE_ILLCHAR = -1765328251,
00369     PARSE_MALFORMED = -1765328250,
00370     CONFIG_CANTOPEN = -1765328249,
00371     CONFIG_BADFORMAT = -1765328248,
00372     CONFIG_NOTENUFSPACE = -1765328247,
00373     BADMSGTYPE = -1765328246,
00374     CC_BADNAME = -1765328245,
00375     CC_UNKNOWN_TYPE = -1765328244,
00376     CC_NOTFOUND = -1765328243,
00377     CC_END = -1765328242,
00378     NO_TKT_SUPPLIED = -1765328241,
00379     KRB5KRB_AP_WRONG_PRINC = -1765328240,
00380     KRB5KRB_AP_ERR_TKT_INVALID = -1765328239,
00381     PRINC_NOMATCH = -1765328238,
00382     KDCREP_MODIFIED = -1765328237,
00383     KDCREP_SKEW = -1765328236,
00384     IN_TKT_REALM_MISMATCH = -1765328235,
00385     PROG_ETYPE_NOSUPP = -1765328234,
00386     PROG_KEYTYPE_NOSUPP = -1765328233,
00387     WRONG_ETYPE = -1765328232,
00388     PROG_SUMTYPE_NOSUPP = -1765328231,
00389     REALM_UNKNOWN = -1765328230,
00390     SERVICE_UNKNOWN = -1765328229,
00391     KDC_UNREACH = -1765328228,
00392     NO_LOCALNAME = -1765328227,
00393     MUTUAL_FAILED = -1765328226,
00394     RC_TYPE_EXISTS = -1765328225,
00395     RC_MALLOC = -1765328224,
00396     RC_TYPE_NOTFOUND = -1765328223,
00397     RC_UNKNOWN = -1765328222,
00398     RC_REPLAY = -1765328221,
00399     RC_IO = -1765328220,
00400     RC_NOIO = -1765328219,
00401     RC_PARSE = -1765328218,
00402     RC_IO_EOF = -1765328217,
00403     RC_IO_MALLOC = -1765328216,
00404     RC_IO_PERM = -1765328215,
00405     RC_IO_IO = -1765328214,
00406     RC_IO_UNKNOWN = -1765328213,
00407     RC_IO_SPACE = -1765328212,
00408     TRANS_CANTOPEN = -1765328211,
00409     TRANS_BADFORMAT = -1765328210,
00410     LNAME_CANTOPEN = -1765328209,
00411     LNAME_NOTRANS = -1765328208,
00412     LNAME_BADFORMAT = -1765328207,
00413     CRYPTO_INTERNAL = -1765328206,
00414     KT_BADNAME = -1765328205,
00415     KT_UNKNOWN_TYPE = -1765328204,
00416     KT_NOTFOUND = -1765328203,
00417     KT_END = -1765328202,
00418     KT_NOWRITE = -1765328201,
00419     KT_IOERR = -1765328200,
00420     NO_TKT_IN_RLM = -1765328199,
00421     DES_BAD_KEYPAR = -1765328198,
00422     DES_WEAK_KEY = -1765328197,
00423     BAD_ENCTYPE = -1765328196,
00424     BAD_KEYSIZE = -1765328195,
00425     BAD_MSIZE = -1765328194,
00426     CC_TYPE_EXISTS = -1765328193,
00427     KT_TYPE_EXISTS = -1765328192,
00428     CC_IO = -1765328191,
00429     FCC_PERM = -1765328190,
00430     FCC_NOFILE = -1765328189,
00431     FCC_INTERNAL = -1765328188,
00432     CC_WRITE = -1765328187,
00433     CC_NOMEM = -1765328186,
00434     CC_FORMAT = -1765328185,
00435     CC_NOT_KTYPE = -1765328184,
00436     INVALID_FLAGS = -1765328183,
00437     NO_2ND_TKT = -1765328182,
00438     NOCREDS_SUPPLIED = -1765328181,
00439     SENDAUTH_BADAUTHVERS = -1765328180,
00440     SENDAUTH_BADAPPLVERS = -1765328179,
00441     SENDAUTH_BADRESPONSE = -1765328178,
00442     SENDAUTH_REJECTED = -1765328177,
00443     PREAUTH_BAD_TYPE = -1765328176,
00444     PREAUTH_NO_KEY = -1765328175,
00445     PREAUTH_FAILED = -1765328174,
00446     RCACHE_BADVNO = -1765328173,
00447     CCACHE_BADVNO = -1765328172,
00448     KEYTAB_BADVNO = -1765328171,
00449     PROG_ATYPE_NOSUPP = -1765328170,
00450     RC_REQUIRED = -1765328169,
00451     ERR_BAD_HOSTNAME = -1765328168,
00452     ERR_HOST_REALM_UNKNOWN = -1765328167,
00453     SNAME_UNSUPP_NAMETYPE = -1765328166,
00454     KRB_AP_ERR_V4_REPLY = -1765328165,
00455     REALM_CANT_RESOLVE = -1765328164,
00456     TKT_NOT_FORWARDABLE = -1765328163,
00457     FWD_BAD_PRINCIPAL = -1765328162,
00458     GET_IN_TKT_LOOP = -1765328161,
00459     CONFIG_NODEFREALM = -1765328160,
00460     SAM_UNSUPPORTED = -1765328159,
00461     SAM_INVALID_ETYPE = -1765328158,
00462     SAM_NO_CHECKSUM = -1765328157,
00463     SAM_BAD_CHECKSUM = -1765328156,
00464     OBSOLETE_FN = -1765328146,
00465     ERR_BAD_S2K_PARAMS = -1765328139,
00466     ERR_NO_SERVICE = -1765328138,
00467     CC_NOSUPP = -1765328137,
00468     DELTAT_BADFORMAT = -1765328136,
00469     PLUGIN_NO_HANDLE = -1765328135,
00470     PLUGIN_OP_NOTSUPP = -1765328134
00471 };
00472 
00477 } // namespace KRB_API
00478 
00479 } // namespace GD
00480 
00481 #endif /* GDKERBEROSAUTHHANDLER_H_ */