
_P_U                 @   s   d  d l  m Z m Z d  d l Z d  d l Z d  d l Z d  d l Z d d l m Z m	 Z	 m
 Z
 m Z m Z d d   Z e d k r e   d S)    )absolute_importprint_functionN   )DecodeError__package____version__decodeencodec           #   C   s  d }  t  j d |  d t d d t t f  } | j d d d d	 d
 d d d d d | j d d
 d d d d d  d d | j d d
 d d d d d d d | j   \ } } t |  d k s t j j	   rt |  d k r| j
 s | j ry| t j j	   st j j   } n
 | d } | j d  } t | d | j d | j
 } t t j |   t j d  Wn< t k
 r} z t |  t j d  WYd  d  } ~ Xn X| j d  k rt d  t j d  i  } x1| D])} y | j d d  \ }	 }
 |	 d k rb|
 d d  k rbt |
  d k rbt t t j   t |
 d d      }
 |
 j   r}t |
  }
 n% y t |
  }
 Wn t k
 rYn Xd! d d" d# d$ d  i } |
 | k r| |
 }
 |
 | |	 <Wqt k
 rt d% j |   t j d  YqXqWy9 t | d | j d | j } t |  t j d  Wqt k
 r} z t |  t j d  WYd  d  } ~ XqXn
 | j   d  S)&Na  Encodes or decodes JSON Web Tokens based on input.

  %prog [options] input

Decoding examples:

  %prog --key=secret json.web.token
  %prog --no-verify json.web.token

Encoding requires the key option and takes space separated key/value pairs
separated by equals (=) as input. Examples:

  %prog --key=secret iss=me exp=1302049071
  %prog --key=secret foo=bar exp=+10

The exp key is special and can take an offset to current Unix time.usageprogversionz%s %sz-nz--no-verifyactionZstore_falsedestverifydefaultThelpz'ignore signature verification on decodez--keykeymetavarZKEYzset the secret key to sign withz--alg	algorithmZALGZHS256z0set crypto algorithm to sign with. default=HS256r   r   zutf-8z4Key is required when encoding. See --help for usage.=Zexp+truefalseFZnullzInvalid encoding input at {})optparseZOptionParserr   r   Z
add_option
parse_argslensysstdinisattyr   r   readr	   r   printjsondumpsexitr   splitstrinttimeisdigitfloat
ValueErrorformatr   	ExceptionZ
print_help)r
   pZoptionsZ	argumentstokendataeZpayloadargkvZ	constants r4   ./usr/lib/python3/dist-packages/jwt/__main__.pymain   s    		"%

 
.,
	

#r6   __main__)Z
__future__r   r   r!   r   r   r'    r   r   r   r   r	   r6   __name__r4   r4   r4   r5   <module>   s   (y