ó î?€Yc@sÎddlZddlmZmZd„Zd„Zd„Zd„Zdefd„ƒYZ d e fd „ƒYZ d e fd „ƒYZ d e fd„ƒYZ de fd„ƒYZ de fd„ƒYZdS(iÿÿÿÿN(turlsafe_b64decodeturlsafe_b64encodecCsCt|tƒs!|jdƒ}nt|ƒ}|jdƒjdƒS(Nsutf-8t=(t isinstancetbytestencodeRtdecodetrstrip(tpayloadR((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pytbase64url_encode s cCspt|ƒd}|dkr)|d7}n4|dkrB|d7}n|dkr]tdƒ‚nt|jdƒƒS( Niis==iRisInvalid base64 stringsutf-8(tlent ValueErrorRR(Rtl((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pytbase64url_decodes     cCs:t|tƒr!|jdƒ}ntj|dddtƒS(Nsutf-8t separatorst,t:t sort_keys(RR(RRRtjsontdumpstTrue(tstring((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyt json_encodescCs.t|tƒr!|jdƒ}ntj|ƒS(Nsutf-8(RRRRtloads(R((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyt json_decode%st JWExceptioncBseZRS((t__name__t __module__(((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR+stInvalidJWAAlgorithmcBseZdd„ZRS(cCs7d}|r|d|7}ntt|ƒj|ƒdS(NsInvalid JWA Algorithm names (%s)(tsuperRt__init__(tselftmessagetmsg((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR0sN(RRtNoneR(((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR/stInvalidCEKeyLengthcBseZdZd„ZRS(s€Invalid CEK Key Length. This exception is raised when a Content Encryption Key does not match the required lenght. cCs*d||f}tt|ƒj|ƒdS(Ns&Expected key of length %d bits, got %d(RR#R(RtexpectedtobtainedR!((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR>s(RRt__doc__R(((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR#7stInvalidJWEOperationcBseZdZddd„ZRS(s†Invalid JWS Object. This exception is raised when a requested operation cannot be execute due to unsatisfied conditions. cCsRd}|r|}nd}|r8|dt|ƒ7}ntt|ƒj|ƒdS(NsUnknown Operation Failures {%s}(R"treprRR'R(RR t exceptionR!((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyRJs N(RRR&R"R(((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR'CstInvalidJWEKeyTypecBseZdZd„ZRS(s“Invalid JWE Key Type. This exception is raised when the provided JWK Key does not match the type required by the sepcified algorithm. cCs*d||f}tt|ƒj|ƒdS(NsExpected key type %s, got %s(RR*R(RR$R%R!((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR\s(RRR&R(((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR*UstInvalidJWEKeyLengthcBseZdZd„ZRS(s—Invalid JWE Key Length. This exception is raised when the provided JWK Key does not match the lenght required by the sepcified algorithm. cCs*d||f}tt|ƒj|ƒdS(Ns!Expected key of lenght %d, got %d(RR+R(RR$R%R!((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyRhs(RRR&R(((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyR+as(Rtbase64RRR R RRt ExceptionRRR#R'R*R+(((s3/usr/lib/python2.7/site-packages/jwcrypto/common.pyts