Rudiments: gsscredentials Class Reference

Rudiments

Public Member Functions | List of all members
gsscredentials Class Reference

## Public Member Functions
| gsscredentials ()
| ~gsscredentials ()
bool | setKeytab (const char *keytab)
const char * | getKeytab ()
void | setDesiredLifetime (uint32_t desiredlifetime)
uint32_t | getDesiredLifetime ()
void | addDesiredMechanism (gssmechanism *mech)
void | removeDesiredMechanism (gssmechanism *mech)
bool | inDesiredMechanisms (gssmechanism *mech)
void | clearDesiredMechanisms ()
uint64_t | getDesiredMechanismCount ()
gssmechanism * | getDesiredMechanism (uint64_t index)
bool | acquireForService (const char *name)
bool | acquireForUser (const char *name)
bool | acquired ()
void | close ()
const char * | getName ()
uint32_t | getActualLifetime ()
bool | inActualMechanisms (gssmechanism *mech)
uint64_t | getActualMechanismCount ()
gssmechanism * | getActualMechanism (uint64_t index)
uint32_t | getMajorStatus ()
uint32_t | getMinorStatus ()
const char * | getStatus ()
const char * | getGSSMajorStatus ()
const char * | getGSSMinorStatus ()
const char * | getMechanismMajorStatus ()
const char * | getMechanismMinorStatus ()
const void * | getCredentials ()

## Constructor & Destructor Documentation

## ◆ gsscredentials()

gsscredentials::gsscredentials | ( |  | ) |

Creates an instance of the gsscredentials class.

## ◆ ~gsscredentials()

gsscredentials::~gsscredentials | ( |  | ) |

Deletes this instance of the gsscredentials class.

## Member Function Documentation

## ◆ acquired()

bool gsscredentials::acquired | ( |  | ) |

Returns true if credentials are currently acquired and false otherwise.

## ◆ acquireForService()

bool gsscredentials::acquireForService | ( | const char * | name | ) |

Acquires credentials for service principal "name". Returns true on success and false on failure.

## ◆ acquireForUser()

bool gsscredentials::acquireForUser | ( | const char * | name | ) |

Acquires credentials for user principal "name". Returns true on success and false on failure.

## ◆ addDesiredMechanism()

void gsscredentials::addDesiredMechanism | ( | gssmechanism * | mech | ) |

Adds security mechanism "mech" to the list of security mechanisms that will be requested during a subsequent call to one of the acquire methods.

## ◆ clearDesiredMechanisms()

void gsscredentials::clearDesiredMechanisms | ( |  | ) |

Removes all security mechanism from the list of security mechanisms that will be requested during a subsequent call to one of the acquire methods.

## ◆ close()

void gsscredentials::close | ( |  | ) |

Releases any previously acquired credentials.

## ◆ getActualLifetime()

uint32_t gsscredentials::getActualLifetime | ( |  | ) |

Returns the actual lifetime of the credentials, assigned during the most recent call to an aquire method. Returns the largest unsigned 32-bit integer (indicating an indefinite lifetime, the default) if no call to an acquire method has been made, or if close() has been called.

## ◆ getActualMechanism()

gssmechanism* gsscredentials::getActualMechanism | ( | uint64_t | index | ) |

Returns the "index"'th security mechanism from the list of security mechanisms that were actually used during the most recent call to one of the acquire methods or NULL if no call to an acquire method has been made, or if close() has been called.

## ◆ getActualMechanismCount()

uint64_t gsscredentials::getActualMechanismCount | ( |  | ) |

Returns the number of security mechanisms in the list of security mechanisms that were actually used during the most recent call to one of the acquire methods or 0 if no call to an acquire method has been made, or if close() has been called.

## ◆ getCredentials()

const void* gsscredentials::getCredentials | ( |  | ) |

Returns a platform-specific binary internal representation of the credentials, or NULL if no call has been made to an acquire method, or if close() has been called.

## ◆ getDesiredLifetime()

uint32_t gsscredentials::getDesiredLifetime | ( |  | ) |

Returns the desired credentials-lifetime set by a previous call to setDesiredLifetime() or the largest 32-bit integer (indicating an indefinite lifetime, the default) if no desired credentials-lifetime has been set.

## ◆ getDesiredMechanism()

gssmechanism* gsscredentials::getDesiredMechanism | ( | uint64_t | index | ) |

Returns the "index"'th security mechanism from the list of security mechanisms that will be requested during a subsequent call to one of the acquire methods.

## ◆ getDesiredMechanismCount()

uint64_t gsscredentials::getDesiredMechanismCount | ( |  | ) |

Returns the number of security mechanisms in the list of security mechanisms that will be requested during a subsequent call to one of the acquire methods.

## ◆ getGSSMajorStatus()

const char* gsscredentials::getGSSMajorStatus | ( |  | ) |

Returns the GSS major status string of the most recently failed call.

## ◆ getGSSMinorStatus()

const char* gsscredentials::getGSSMinorStatus | ( |  | ) |

Returns the GSS minor status string of the most recently failed call.

## ◆ getKeytab()

const char* gsscredentials::getKeytab | ( |  | ) |

Returns the location of the keytab that will be used when acquiring credentials.

## ◆ getMajorStatus()

uint32_t gsscredentials::getMajorStatus | ( |  | ) |

Returns the major-status code of the most recently failed call.

## ◆ getMechanismMajorStatus()

const char* gsscredentials::getMechanismMajorStatus | ( |  | ) |

Returns the mechanism major status string of the most recently failed call.

## ◆ getMechanismMinorStatus()

const char* gsscredentials::getMechanismMinorStatus | ( |  | ) |

Returns the mechanism minor status string of the most recently failed call.

## ◆ getMinorStatus()

uint32_t gsscredentials::getMinorStatus | ( |  | ) |

Returns the minor-status code of the most recently failed call.

## ◆ getName()

const char* gsscredentials::getName | ( |  | ) |

Returns the name for which credentials were requested in the most recent call to acquire, if the name was provided as a string. Returns NULL if no call to an acquire method has been made, or if close() has been called.

## ◆ getStatus()

const char* gsscredentials::getStatus | ( |  | ) |

Returns the status string of the most recently failed call.

## ◆ inActualMechanisms()

bool gsscredentials::inActualMechanisms | ( | gssmechanism * | mech | ) |

Returns true if security mechanism "mech" is in the list of security mechanisms that was actually used during the most recent call to one of the acquire methods and false otherwise.

## ◆ inDesiredMechanisms()

bool gsscredentials::inDesiredMechanisms | ( | gssmechanism * | mech | ) |

Returns true if security mechanism "mech" is in the list of security mechanisms that will be requested during a subsequent call to one of the acquire methods and false otherwise.

## ◆ removeDesiredMechanism()

void gsscredentials::removeDesiredMechanism | ( | gssmechanism * | mech | ) |

Removes security mechanism "mech" from the list of security mechanisms that will be requested during a subsequent call to one of the acquire methods.

## ◆ setDesiredLifetime()

void gsscredentials::setDesiredLifetime | ( | uint32_t | desiredlifetime | ) |

Sets the credentials-lifetime that will be requested during subsequent calls to the acquire methods. Setting "desiredlifetime" to the largest 32-bit unsigned integer requests an indefinite lifetime.

## ◆ setKeytab()

bool gsscredentials::setKeytab | ( | const char * | keytab | ) |

Sets the location of the keytab to use when acquiring credentials.