pyspnego API reference
151 public APIs from pyspnego (jborean93/pyspnego) — 53 classes, 33 functions, 65 methods. Signatures extracted by static analysis of the actual source.
Repository: jborean93/pyspnego
| Kind | Count |
|---|---|
| Classes | 53 |
| Functions | 33 |
| Methods | 65 |
API list
func
src.spnego.__main__.main(args:typing.List[str]) -> NoneMain program entry point.
func
src.spnego.__main__.parse_args(args:typing.List[str]) -> argparse.NamespaceParse and return args.
func
src.spnego.__main__.parse_tls_token(b_data:bytes) -> typing.List[typing.Dict[str, typing.Any]]:param b_data: A byte string of the TLS token to parse.
func
src.spnego._asn1.pack_asn1(tag_class:TagClass, constructed:bool, tag_number:typing.Union[TypeTagNumber, int], b_data:bytes) -> bytesPack the ASN.1 value into the ASN.1 bytes.
func
src.spnego._asn1.unpack_asn1(b_data:bytes) -> typing.Tuple[ASN1Value, bytes]Unpacks an ASN.1 TLV into each element.
func
src.spnego._asn1.unpack_asn1_bit_string(value:typing.Union[ASN1Value, bytes]) -> bytesUnpacks an ASN.1 BIT STRING value.
func
src.spnego._asn1.unpack_asn1_boolean(value:typing.Union[ASN1Value, bytes]) -> boolUnpacks an ASN.1 BOOLEAN value.
func
src.spnego._asn1.unpack_asn1_enumerated(value:typing.Union[ASN1Value, bytes]) -> intUnpacks an ASN.1 ENUMERATED value.
func
src.spnego._asn1.unpack_asn1_general_string(value:typing.Union[ASN1Value, bytes]) -> bytesUnpacks an ASN.1 GeneralString value.
func
src.spnego._asn1.unpack_asn1_generalized_time(value:typing.Union[ASN1Value, bytes]) -> datetime.datetimeUnpacks an ASN.1 GeneralizedTime value.
func
src.spnego._asn1.unpack_asn1_integer(value:typing.Union[ASN1Value, bytes]) -> intUnpacks an ASN.1 INTEGER value.
func
src.spnego._asn1.unpack_asn1_object_identifier(value:typing.Union[ASN1Value, bytes]) -> strUnpacks an ASN.1 OBJECT IDENTIFIER value.
func
src.spnego._asn1.unpack_asn1_octet_string(value:typing.Union[ASN1Value, bytes]) -> bytesUnpacks an ASN.1 OCTET STRING value.
func
src.spnego._asn1.unpack_asn1_sequence(value:typing.Union[ASN1Value, bytes]) -> typing.List[ASN1Value]Unpacks an ASN.1 SEQUENCE value.
func
src.spnego._asn1.unpack_asn1_tagged_sequence(value:typing.Union[ASN1Value, bytes]) -> typing.Dict[int, ASN1Value]Unpacks an ASN.1 SEQUENCE value as a dictionary.
class
src.spnego._context.ContextProxyBase class for a authentication context.
method
src.spnego._context.ContextProxy.available_protocols(options:typing.Optional[NegotiateOptions]=None) -> typing.List[str]A list of protocols that the provider can offer.
method
src.spnego._context.ContextProxy.context_attr() -> ContextReqThe context attributes that were negotiated.
method
src.spnego._context.ContextProxy.get_extra_info(name:str, default:typing.Any=None) -> typing.AnyReturn information about the security context.
method
src.spnego._context.ContextProxy.negotiated_protocol() -> typing.Optional[str]The name of the negotiated protocol.
method
src.spnego._context.ContextProxy.new_context() -> 'ContextProxy'Creates a new security context.
method
src.spnego._context.ContextProxy.session_key() -> bytesThe derived session key.
method
src.spnego._context.ContextProxy.sign(data:bytes, qop:typing.Optional[int]=None) -> bytesGenerates a signature/MIC for a message.
method
src.spnego._context.ContextProxy.step(in_token:typing.Optional[bytes]=None, *channel_bindings:typing.Optional[GssChannelBindings]=None) -> typing.Optional[bytes]Performs a negotiation step.
method
src.spnego._context.ContextProxy.unwrap(data:bytes) -> UnwrapResultUnwrap a message.
method
src.spnego._context.ContextProxy.unwrap_iov(iov:typing.Iterable[IOV]) -> IOVUnwrapResultUnwrap/Decrypt an IOV buffer.
method
src.spnego._context.ContextProxy.unwrap_winrm(header:bytes, data:bytes) -> bytesUnwrap/Decrypt a WinRM message.
method
src.spnego._context.ContextProxy.verify(data:bytes, mic:bytes) -> intVerify the signature/MIC for a message.
method
src.spnego._context.ContextProxy.wrap(data:bytes, encrypt:bool=True, qop:typing.Optional[int]=None) -> WrapResultWrap a message, optionally with encryption.
method
src.spnego._context.ContextProxy.wrap_iov(iov:typing.Iterable[IOV], encrypt:bool=True, qop:typing.Optional[int]=None) -> IOVWrapResultWrap/Encrypt an IOV buffer.
method
src.spnego._context.ContextProxy.wrap_winrm(data:bytes) -> WinRMWrapResultWrap/Encrypt data for use with WinRM.
class
src.spnego._context.IOVUnwrapResultResult of the `unwrap_iov()` function.
class
src.spnego._context.IOVWrapResultResult of the `wrap_iov()` function.
class
src.spnego._context.SecPkgContextSizesSizes of important structures used for messages.
class
src.spnego._context.UnwrapResultResult of the `unwrap()` function.
class
src.spnego._context.WinRMWrapResultResult of the `wrap_winrm()` function.
class
src.spnego._context.WrapResultResult of the `wrap()` function.
class
src.spnego._credential.CredentialCacheCached credential.
class
src.spnego._credential.KerberosCCacheKerberos CCache Credential.
class
src.spnego._credential.KerberosKeytabKerberos Keytab Credential.
class
src.spnego._credential.NTLMHashNTLM LM/NT Hash credential.
method
src.spnego._credential.NTLMHash.supported_protocols() -> typing.List[str]List of protocols the credential can be used for.
class
src.spnego._credential.PasswordPlaintext username and password credential.
method
src.spnego._credential.Password.supported_protocols() -> typing.List[str]List of protocols the credential can be used for.
class
src.spnego._credssp.CredSSPProxyCredSSP proxy class CredSSP authentication.
class
src.spnego._credssp_structures.NegoDataCredSSP NegoData structure.
method
src.spnego._credssp_structures.NegoData.pack() -> bytesPacks the NegoData as a byte string.
method
src.spnego._credssp_structures.NegoData.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'NegoData'Unpacks the NegoData TLV value.
class
src.spnego._credssp_structures.TSCredentialsCredSSP TSCredentials structure.
method
src.spnego._credssp_structures.TSCredentials.cred_type() -> intThe credential type of credentials as an integer.
method
src.spnego._credssp_structures.TSCredentials.pack() -> bytesPacks the TSCredentials as a byte string.
method
src.spnego._credssp_structures.TSCredentials.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'TSCredentials'Unpacks the TSCredentials TLV value.
class
src.spnego._credssp_structures.TSCspDataDetailCredSSP TSCspDataDetail structure.
method
src.spnego._credssp_structures.TSCspDataDetail.pack() -> bytesPacks the TSCspDataDetail as a byte string.
method
src.spnego._credssp_structures.TSCspDataDetail.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'TSCspDataDetail'Unpacks the TSCspDataDetail TLV value.
class
src.spnego._credssp_structures.TSPasswordCredsCredSSP TSPasswordCreds structure.
method
src.spnego._credssp_structures.TSPasswordCreds.pack() -> bytesPacks the TSPasswordCreds as a byte string.
method
src.spnego._credssp_structures.TSPasswordCreds.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'TSPasswordCreds'Unpacks the TSPasswordCreds TLV value.
class
src.spnego._credssp_structures.TSRemoteGuardCredsCredSSP TSRemoteGuardCreds structure.
method
src.spnego._credssp_structures.TSRemoteGuardCreds.pack() -> bytesPacks the TSRemoteGuardCreds as a byte string.
method
src.spnego._credssp_structures.TSRemoteGuardCreds.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'TSRemoteGuardCreds'Unpacks the TSRemoteGuardCreds TLV value.
class
src.spnego._credssp_structures.TSRemoteGuardPackageCredCredSSP TSRemoteGuardPackageCred structure.
method
src.spnego._credssp_structures.TSRemoteGuardPackageCred.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'TSRemoteGuardPackageCred'Unpacks the TSRemoteGuardPackageCred TLV value.
class
src.spnego._credssp_structures.TSRequestCredSSP TSRequest structure.
method
src.spnego._credssp_structures.TSRequest.pack() -> bytesPacks the TSRequest as a byte string.
method
src.spnego._credssp_structures.TSRequest.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'TSRequest'Unpacks the TSRequest TLV value.
class
src.spnego._credssp_structures.TSSmartCardCredsCredSSP TSSmartCardCreds structure.
method
src.spnego._credssp_structures.TSSmartCardCreds.pack() -> bytesPacks the TSSmartCardCreds as a byte string.
method
src.spnego._credssp_structures.TSSmartCardCreds.unpack(b_data:typing.Union[ASN1Value, bytes]) -> 'TSSmartCardCreds'Unpacks the TSSmartCardCreds TLV value.
class
src.spnego._gss.GSSAPIProxyGSSAPI proxy class for GSSAPI on Linux.
class
src.spnego._kerberos.EncryptedDataKerberos EncryptedData container.
class
src.spnego._kerberos.KdcReqBodyThe KRB_AS_REQ message.
class
src.spnego._kerberos.KrbApRepThe KRB_AP_REP message.
class
src.spnego._kerberos.KrbApReqThe KRB_AP_REQ message.
class
src.spnego._kerberos.KrbAsRepThe KRB_AS_REP message.
class
src.spnego._kerberos.KrbAsReqThe KRB_AS_REQ message.
class
src.spnego._kerberos.KrbErrorThe KRB_ERROR message.
class
src.spnego._kerberos.PADataKerberos PA-DATA.
class
src.spnego._kerberos.PAETypeInfo2Kerberos PA-ETYPE-INFO2 container.
class
src.spnego._kerberos.TicketKerberos Ticket.
func
src.spnego._kerberos.unpack_hostname(value:typing.Union[bytes, ASN1Value]) -> 'HostAddress'Unpacks an ASN.1 value to a HostAddress.
func
src.spnego._kerberos.unpack_principal_name(value:typing.Union[bytes, ASN1Value]) -> 'PrincipalName'Unpacks an ASN.1 value to a PrincipalName.
class
src.spnego._negotiate.NegotiateProxyA context wrapper for a Python managed SPNEGO context.
class
src.spnego._ntlm.NTLMProxyA context wrapper for a Python managed NTLM context.
class
src.spnego._ntlm_raw.crypto.RC4HandleRC4 class to wrap the underlying crypto function.
method
src.spnego._ntlm_raw.crypto.RC4Handle.reset() -> NoneReset's the cipher stream back to the original state.
method
src.spnego._ntlm_raw.crypto.RC4Handle.update(b_data:bytes) -> bytesUpdate the RC4 stream and return the encrypted/decrypted bytes.
func
src.spnego._ntlm_raw.crypto.crc32(m:bytes) -> bytesSimple wrapper function to generate a CRC32 checksum.
func
src.spnego._ntlm_raw.crypto.des(k:bytes, d:bytes) -> bytesDES encryption.
func
src.spnego._ntlm_raw.crypto.desl(k:bytes, d:bytes) -> bytesEncryption using the DES Long algorithm.
func
src.spnego._ntlm_raw.crypto.hmac_md5(key:bytes, data:bytes) -> bytesSimple wrapper function for a HMAC MD5 digest.
func
src.spnego._ntlm_raw.crypto.kxkey(flags:int, session_base_key:bytes, lmowf:bytes, lm_response:bytes, server_challenge:bytes) -> bytesNTLM KXKEY function.
func
src.spnego._ntlm_raw.crypto.md5(m:bytes) -> bytesSimple wrapper to generate a MD5 checksum.
func
src.spnego._ntlm_raw.crypto.rc4init(k:bytes) -> RC4HandleInitialization of the RC4 handle using the key specified.
func
src.spnego._ntlm_raw.crypto.rc4k(k:bytes, d:bytes) -> bytesRC4 encryption with an explicit key.
func
src.spnego._ntlm_raw.crypto.sealkey(flags:int, session_key:bytes, usage:str) -> bytesNTLM SEALKEY function.
func
src.spnego._ntlm_raw.crypto.signkey(flags:int, session_key:bytes, usage:str) -> bytesNTLM SIGNKEY function.
class
src.spnego._ntlm_raw.des.DESCreates a DES cipher.
method
src.spnego._ntlm_raw.des.DES.decrypt(data:bytes) -> bytesDecrypt a byte string.
method
src.spnego._ntlm_raw.des.DES.encrypt(data:bytes) -> bytesEncrypt a byte string.
method
src.spnego._ntlm_raw.des.DES.key56_to_key64(key:bytes) -> bytesConvert 7 byte key to 8 bytes.
func
src.spnego._ntlm_raw.md4.md4(data:bytes) -> bytesPython implementation of md4 hashing.
method
src.spnego._ntlm_raw.messages.Authenticate.lm_challenge_response() -> typing.Optional[bytes]The LmChallengeResponse or None if not set.
method
src.spnego._ntlm_raw.messages.Authenticate.mic() -> typing.Optional[bytes]The MIC for the Authenticate message.
method
src.spnego._ntlm_raw.messages.Authenticate.nt_challenge_response() -> typing.Optional[bytes]The NtChallengeResponse or None if not set.
method
src.spnego._ntlm_raw.messages.Authenticate.user_name() -> typing.Optional[str]The name of the user to be authenticated.
method
src.spnego._ntlm_raw.messages.Authenticate.version() -> typing.Optional['Version']The client NTLM version.
class
src.spnego._ntlm_raw.messages.AvFlagsMsvAvFlags for an AV_PAIR.
class
src.spnego._ntlm_raw.messages.AvIdID for an NTLM AV_PAIR.
method
src.spnego._ntlm_raw.messages.Challenge.flags() -> intThe negotiate flags supported by the server.
method
src.spnego._ntlm_raw.messages.Challenge.server_challenge() -> bytesThe server's 8 byte nonce challenge.
method
src.spnego._ntlm_raw.messages.Challenge.target_name() -> typing.Optional[str]The name of the server authentication realm.
method
src.spnego._ntlm_raw.messages.Challenge.version() -> typing.Optional['Version']The server NTLM version.
class
src.spnego._ntlm_raw.messages.FileTimeWindows FILETIME structure.
method
src.spnego._ntlm_raw.messages.FileTime.from_datetime(dt:datetime.datetime, ns:int=0) -> 'FileTime'Creates a FileTime object from a datetime object.
method
src.spnego._ntlm_raw.messages.FileTime.pack() -> bytesPacks the structure to bytes.
method
src.spnego._ntlm_raw.messages.FileTime.unpack(b_data:bytes) -> 'FileTime'Unpacks the structure from bytes.
class
src.spnego._ntlm_raw.messages.NTLMMessageBase NTLM message class that defines the pack and unpack functions.
method
src.spnego._ntlm_raw.messages.NTLMMessage.pack() -> bytesPacks the structure to bytes.
method
src.spnego._ntlm_raw.messages.NTLMMessage.unpack(b_data:bytes, encoding:typing.Optional[str]=None) -> 'NTLMMessage'Unpacks the structure from bytes.
class
src.spnego._ntlm_raw.messages.NegotiateFlagsNTLM Negotiation flags.
class
src.spnego._ntlm_raw.messages.SingleHostSingle_Host_Data structure for NTLM TargetInfo entry.
method
src.spnego._ntlm_raw.messages.SingleHost.pack() -> bytesPacks the structure to bytes.
method
src.spnego._ntlm_raw.messages.SingleHost.unpack(b_data:bytes) -> 'SingleHost'Creates a SignleHost object from raw bytes.
method
src.spnego._ntlm_raw.messages.TargetInfo.pack() -> bytesPacks the structure to bytes.
method
src.spnego._ntlm_raw.messages.TargetInfo.unpack(b_data:bytes) -> 'TargetInfo'Unpacks the structure from bytes.
class
src.spnego._ntlm_raw.messages.VersionA structure contains the OS information.
method
src.spnego._ntlm_raw.messages.Version.pack() -> bytesPacks the structure to bytes.
method
src.spnego._ntlm_raw.messages.Version.unpack(b_data:bytes) -> 'Version'Creates a Version object from raw bytes.
func
src.spnego._ntlm_raw.security.seal(flags:int, handle:RC4Handle, signing_key:bytes, seq_num:int, b_data:bytes, *to_sign:typing.Optional[bytes]=None) -> typing.Tuple[bytes, bytes]Create a sealed NTLM message.
func
src.spnego._ntlm_raw.security.sign(flags:int, handle:RC4Handle, signing_key:bytes, seq_num:int, b_data:bytes) -> bytesCreate a NTLM signature.
class
src.spnego._spnego.InitialContextTokenGSSAPI InitialContextToken object.
method
src.spnego._spnego.InitialContextToken.pack() -> bytesPacks the InitialContextToken as a byte string.
method
src.spnego._spnego.InitialContextToken.unpack(b_data:bytes) -> 'InitialContextToken'Unpacks the InitialContextToken TLV value.
class
src.spnego._spnego.NegTokenInitThe NegTokenInit GSSAPI value.
method
src.spnego._spnego.NegTokenInit.pack() -> bytesPacks the NegTokenInit as a byte string.
method
src.spnego._spnego.NegTokenInit.unpack(b_data:bytes) -> 'NegTokenInit'Unpacks the NegTokenInit TLV value.
class
src.spnego._spnego.NegTokenRespThe NegTokenResp GSSAPI value.
method
src.spnego._spnego.NegTokenResp.pack() -> bytesPacks the NegTokenResp as a byte string.
method
src.spnego._spnego.NegTokenResp.unpack(b_data:bytes) -> 'NegTokenResp'Unpacks the NegTokenResp TLV value.
func
src.spnego._spnego.pack_mech_type_list(mech_list:typing.Union[str, typing.List[str], typing.Tuple[str, ...], typing.Set[str]]) -> bytesPacks a list of OIDs for the mechListMIC value.
class
src.spnego._sspi.SSPIProxySSPI proxy class for pure SSPI on Windows.
class
src.spnego.exceptions.ErrorCodeCommon error codes for SPNEGO operations.
class
src.spnego.exceptions.SpnegoErrorCommon error for SPNEGO exception.
method
src.spnego.exceptions.SpnegoError.nt_status() -> intThe Windows NT Status code that represents this error.
class
src.spnego.iov.BufferTypeBuffer types to use for an IOVBuffer type.
class
src.spnego.iov.IOVBufferA buffer to pass as a list to :meth:`wrap_iov()`.
class
src.spnego.iov.IOVResBufferResults of an IOV operation.
class
src.spnego.tls.CredSSPTLSContextA TLS context generated for CredSSP.
func
src.spnego.tls.default_tls_context(usage:str='initiate') -> CredSSPTLSContextCredSSP TLSContext with sane defaults.
func
src.spnego.tls.get_certificate_public_key(data:bytes) -> bytesPublic key bytes of an X.509 Certificate.
About this data
These signatures were extracted from the public source of jborean93/pyspnego
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.