�
�[/\c @@ sM d d l m Z d d l m Z d d l m Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l
m Z d d l Z
d d l Z
e j d � Z d Z d e
j j f d
� � YZ d d � Z d
e f d � � YZ d d d � � YZ d d d � � YZ d d d � � YZ d � Z d � Z d d d � � YZ d S( i ( t print_function( t absolute_import( t unicode_literals( t EnumN( t _u dnfi= t DnssecErrorc B@ s e Z d Z RS( u-
Exception used in the dnssec module
( t __name__t
__module__t __doc__( ( ( s. /usr/lib/python2.7/site-packages/dnf/dnssec.pyR ) s u _openpgpkeyc C@ s� | j d � } t | � d k r- t � � n | d } | d } t j � } | j | j d � � t j | j � d d !� j
d � j � } | d | d | S( u�
Implements RFC 7929, section 3
https://tools.ietf.org/html/rfc7929#section-3
:param email_address:
:param tag:
:return:
u @i i i u utf-8i u .( t splitt lenR t hashlibt sha256t updatet encodet base64t b16encodet digestt decodet lower( t
email_addresst tagR t localt domaint hashR ( ( s. /usr/lib/python2.7/site-packages/dnf/dnssec.pyt email2location0 s
t Validityc B@ s2 e Z d Z d Z d Z d Z d Z d Z d Z RS( u�
Output of the verification algorithm.
TODO: this type might be simplified in order to less reflect the underlying DNS layer.
TODO: more specifically the variants from 3 to 5 should have more understandable names
i i i i i i ( R R R t VALIDt REVOKEDt PROVEN_NONEXISTENCEt RESULT_NOT_SECUREt BOGUS_RESULTt ERROR( ( ( s. /usr/lib/python2.7/site-packages/dnf/dnssec.pyR G s t NoKeyc B@ s e Z d Z RS( u�
This class represents an absence of a key in the cache. It is an expression of non-existence
using the Python's type system.
( R R R ( ( ( s. /usr/lib/python2.7/site-packages/dnf/dnssec.pyR! U s t KeyInfoc B@ s, e Z d Z d d d � Z e d � � Z RS( uv
Wrapper class for email and associated verification key, where both are represented in
form of a string.
c C@ s | | _ | | _ d S( N( t emailt key( t selfR# R$ ( ( s. /usr/lib/python2.7/site-packages/dnf/dnssec.pyt __init__b s c C@ s� t j d | � } | d
k r'