---
name: "gss_inquire_cred_by_mech"
section: "3"
platform: "linux"
package: "gss-man"
version: "1.0.4-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gss_inquire_cred_by_mech"
---

# gss\_inquire\_cred\_by\_mech(3)

API function

## NAME

gss\_inquire\_cred\_by\_mech - API function

## SYNOPSIS

**#include \<gss.h\>**

**OM\_uint32 gss\_inquire\_cred\_by\_mech(OM\_uint32 \*** *minor\_status***, const gss\_cred\_id\_t** *cred\_handle***, const gss\_OID** *mech\_type***, gss\_name\_t \*** *name***, OM\_uint32 \*** *initiator\_lifetime***, OM\_uint32 \*** *acceptor\_lifetime***, gss\_cred\_usage\_t \*** *cred\_usage***);**

## ARGUMENTS

- OM\_uint32 \* minor\_status

  (Integer, modify) Mechanism specific status code.

- const gss\_cred\_id\_t cred\_handle

  (gss\_cred\_id\_t, read) A handle that refers to the\
     target credential.  Specify GSS\_C\_NO\_CREDENTIAL to inquire about\
     the default initiator principal.

- const gss\_OID mech\_type

  (gss\_OID, read) The mechanism for which information\
    should be returned.

- gss\_name\_t \* name

  (gss\_name\_t, modify, optional) The name whose identity the\
     credential asserts.  Storage associated with this name must be\
     freed by the application after use with a call to\
     **gss\_release\_name()**.  Specify NULL if not required.

- OM\_uint32 \* initiator\_lifetime

  (Integer, modify, optional) The number of\
     seconds for which the credential will remain capable of\
     initiating security contexts under the specified mechanism.  If\
     the credential can no longer be used to initiate contexts, or if\
     the credential usage for this mechanism is GSS\_C\_ACCEPT, this\
     parameter will be set to zero.  If the implementation does not\
     support expiration of initiator credentials, the value\
     GSS\_C\_INDEFINITE will be returned.  Specify NULL if not required.

- OM\_uint32 \* acceptor\_lifetime

  (Integer, modify, optional) The number of\
     seconds for which the credential will remain capable of accepting\
     security contexts under the specified mechanism.  If the\
     credential can no longer be used to accept contexts, or if the\
     credential usage for this mechanism is GSS\_C\_INITIATE, this\
     parameter will be set to zero.  If the implementation does not\
     support expiration of acceptor credentials, the value\
     GSS\_C\_INDEFINITE will be returned.  Specify NULL if not required.

- gss\_cred\_usage\_t \* cred\_usage

  (gss\_cred\_usage\_t, modify, optional) How the\
     credential may be used with the specified mechanism.  One of the\
     following: GSS\_C\_INITIATE, GSS\_C\_ACCEPT, GSS\_C\_BOTH. Specify NULL\
     if not required.

## DESCRIPTION

Obtains per-mechanism information about a credential.

## RETURN VALUE

\`GSS\_S\_COMPLETE\`: Successful completion.

\`GSS\_S\_NO\_CRED\`: The referenced credentials could not be accessed.

\`GSS\_S\_DEFECTIVE\_CREDENTIAL\`: The referenced credentials were invalid.

\`GSS\_S\_CREDENTIALS\_EXPIRED\`: The referenced credentials have expired.  If the lifetime parameter was not passed as NULL, it will be set to 0.

## REPORTING BUGS

Report bugs to \<bug-gss@gnu.org\>. GNU Generic Security Service home page: http://www.gnu.org/software/gss/ General help using GNU software: http://www.gnu.org/gethelp/

## COPYRIGHT

Copyright © 2003-2022 Simon Josefsson.\
 Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

## SEE ALSO

The full documentation for **gss** is maintained as a Texinfo manual.  If the **info** and **gss** programs are properly installed at your site, the command

-

  **info gss**

should give you access to the complete manual.
