File: //lib64/python3.9/site-packages/gssapi/__pycache__/names.cpython-39.opt-1.pyc
a
��_/3 � @ s� d dl Z d dlmZ d dlmZ d dlmZ d dlmZ e j rPd dl
mZmZ nd dl
mZmZ e�d�Ze�d�ZG d d
� d
ej�ZG dd� de�ZdS )
� N)�names)�NameType)�named_tuples)�_utils)�MutableMapping�IterableZrfc6680Zrfc6680_comp_oidc s� e Zd ZdZdZd)� fdd� Zd*dd�Zd d
� Zdd� Zd
d� Z dd� Z
edd� �Zdd� Z
dd� Zdd� Zd+dd�Zdd� Zdd� Zdd � Zd!d"� Zed#d$� �Zed%d&� �Zed'd(� �Z� ZS ),�Namea� A GSSAPI Name
This class represents a GSSAPI name which may be used with and/or returned
by other GSSAPI methods.
It inherits from the low-level GSSAPI :class:`~gssapi.raw.names.Name`
class, and thus may used with both low-level and high-level API methods.
This class may be pickled and unpickled, as well as copied.
The :func:`str` and :func:`bytes` methods may be used to retrieve the
text of the name.
Note:
Name strings will be automatically converted to and from unicode
strings as appropriate. If a method is listed as returning a
:class:`str` object, it will return a unicode string.
The encoding used will be python-gssapi's current encoding, which
defaults to UTF-8.
� _attr_objNFc s� |d ur||rlt d u rtd��td ur\t�|tj�}tj|dd�}|jtjkrjt�|tj �}qzt�|tj �}q�t�|tj �}n8t
|tj�r�|}n&t
|tj
�r�|�t�� �}t�||�}tt| ��| |�S )N�SYour GSSAPI implementation does not support RFC 6680 (the GSSAPI naming extensions)T�� name_type)�
rname_rfc6680�NotImplementedError�rname_rfc6680_comp_oid�rnameZimport_namer Zcomposite_export�display_namer �export�
isinstancer �six� text_type�encoder �
_get_encoding�super�__new__)�cls�baser �token� composite� base_nameZ
displ_name�� __class__� �2/usr/lib64/python3.9/site-packages/gssapi/names.pyr + s* ��zName.__new__c C s t durt| �| _nd| _dS )ag
The constructor can be used to "import" a name from a human readable
representation, or from a token, and can also be used to convert a
low-level :class:`gssapi.raw.names.Name` object into a high-level
object.
If a :class:`~gssapi.raw.names.Name` object from the low-level API
is passed as the `base` argument, it will be converted into a
high-level object.
If the `token` argument is used, the name will be imported using
the token. If the token was exported as a composite token,
pass `composite=True`.
Otherwise, a new name will be created, using the `base` argument as
the human-readable string and the `name_type` argument to denote the
name type.
Raises:
BadNameTypeError
BadNameError
BadMechanismError
N)r
�_NameAttributeMappingr )�selfr r r r r! r! r"