codekingpro/portable-devtools
114k
1import typing as t2 3if t.TYPE_CHECKING:4 from gssapi.raw.creds import Creds5 from gssapi.raw.named_tuples import AddCredResult6 from gssapi.raw.names import Name7 from gssapi.raw.oids import OID8 9 10def add_cred_with_password(11 input_cred: "Creds",12 name: "Name",13 mech: "OID",14 password: bytes,15 usage: str = 'initiate',16 init_lifetime: t.Optional[int] = None,17 accept_lifetime: t.Optional[int] = None,18) -> "AddCredResult":19 """Add a credential-element to a credential using provided password.20 21 This function is originally from Solaris and is not documented by either22 MIT or Heimdal.23 24 In general, it functions similarly to :func:`~gssapi.raw.creds.add_cred`.25 26 Args:27 input_cred (~gssapi.raw.creds.Creds): the credentials to add to28 name (~gssapi.raw.names.Name): the name to acquire credentials for29 mech (~gssapi.raw.types.MechType): the desired mechanism. Note that30 this is both singular and required31 password (bytes): the password used to acquire credentialss with32 usage (str): the usage type for the credentials: may be33 'initiate', 'accept', or 'both'34 init_lifetime (int): the lifetime, in seconds, for the credentials to35 remain valid when using them to initiate security contexts (or None36 for indefinite)37 accept_lifetime (int): the lifetime, in seconds, for the credentials to38 remain valid when using them to accept security contexts (or None39 for indefinite)40 41 Returns:42 AddCredResult: the actual mechanisms with which the credentials may be43 used, the actual initiator TTL in seconds, and the actual acceptor TTL44 in seconds (the TTLs may be None for indefinite or not supported)45 46 Raises:47 ~gssapi.exceptions.GSSError48 """49 