D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
lib64
/
python3.9
/
site-packages
/
gssapi
/
__pycache__
/
Filename :
sec_contexts.cpython-39.pyc
back
Copy
a ��_�J � @ s� d dl Z d dlmZ d dlmZ d dlmZ d dlm Z m Z d dlmZ d dlmZ d dlmZ d dlmZ e �ej�G d d � d ej��ZdS )� N)�sec_contexts)�message)�named_tuples)�RequirementFlag�IntEnumFlagSet)�_utils)�Name)�Credentialsc s e Zd ZdZd5� fdd� Zd6dd�Zdd� Zd d � Zdd� Zd d� Z dd� Z dd� Zd7dd�Zdd� Z dd� ZdZejdd� �Zedd� �Zedd � �Ze�d!d"�Ze�d#d$�Ze�d%d&�Ze�d'd(�Ze�d)d*�Zeejd+d,� ��Zejd8d-d.��Zd/d0� Zd9d1d2�Z d3d4� Z!� Z"S ):�SecurityContexta� A GSSAPI Security Context This class represents a GSSAPI security context that may be used with and/or returned by other GSSAPI methods. It inherits from the low-level GSSAPI :class:`~gssapi.raw.sec_contexts.SecurityContext` class, and thus may used with both low-level and high-level API methods. This class may be pickled and unpickled (the attached delegated credentials object will not be preserved, however). Nc s$ |d urt �|�}tt| ��| |�S �N)� rsec_contextsZimport_sec_context�superr �__new__) �cls�base�token�name�creds�lifetime�flags�mech�channel_bindings�usage�� __class__� �9/usr/lib64/python3.9/site-packages/gssapi/sec_contexts.pyr s zSecurityContext.__new__c C s4 d| _ |du r�|du r�| dur@| dvr8d} tj| dd��| | _n2|dur\|jdkr\|j| _n|durld| _nd| _| jdkr�|du r�td ��|| _|| _tt|�| _ || _ n(|dus�|dus�|dus�|dur�td ��|| _|| _d| _ nBz| jr�d| _nd| _W n( tj�y( d} tj| dd��Y n0 d| _dS )a The constructor creates a new security context, but does not begin the initiate or accept process. If the `base` argument is used, an existing :class:`~gssapi.raw.sec_contexts.SecurityContext` object from the low-level API is converted into a high-level object. If the `token` argument is passed, the security context is imported using the token. Otherwise, a new security context is created. If the `usage` argument is not passed, the constructor will attempt to detect what the appropriate usage is based on either the existing security context (if `base` or `token` are used) or the argument set. For a security context of the `initiate` usage, the `name` argument must be used, and the `creds`, `mech`, `flags`, `lifetime`, and `channel_bindings` arguments may be used as well. For a security context of the `accept` usage, the `creds` and `channel_bindings` arguments may optionally be used. N)�initiate�acceptz+Usage must be either 'initiate' or 'accept'zsecurity context)�objZbothr r zNYou must pass the 'name' argument when creating an initiating security contextzVYou must pass at most the 'creds' argument when creating an accepting security contextz7Cannot extract usage from a partially completed context)Z _last_err�excsZUnknownUsageErrorr � TypeError�_target_name�_mechr r �_desired_flags�_desired_lifetime�_channel_bindings�_creds�_delegated_creds�locally_initiated�MissingContextError� _complete)�selfr r r r r r r r r �msgr r r �__init__&