3 گaS @sRdZddlmZddlZGdddejZGdddejZGdd d ejZdS) zACME-specific JWS. The JWS implementation in josepy only implements the base JOSE standard. In order to support the new header fields defined in ACME, this module defines some ACME-specific classes that layer on top of josepy. )OptionalNc@sTeZdZdZejddejdZejdddZejdddZ ej e e dd d Zd S) Headerz?ACME-specific JOSE Header. Implements nonce, kid, and url. nonceT) omitemptyencoderkid)rurl)valuereturncCsDy tj|Stjk r>}ztjdj|WYdd}~XnXdS)NzInvalid nonce: {0})joseZdecode_b64joseZDeserializationErrorformat)r errorr/usr/lib/python3.6/jws.pyrs z Header.nonceN) __name__ __module__ __qualname____doc__r FieldZencode_b64joserrrdecoderstrbytesrrrrr s rc@s2eZdZdZejjZeZ ej dde e j dZ dS) SignaturezGACME-specific Signature. Uses ACME-specific Header for customer fields.headerT)rdefaultrN) rrrrr r _orig_slots __slots__rZ header_clsrZ from_jsonrrrrrrs rc sVeZdZdZeZejjZ e de ej ej ee eeeeejdfdd ZZS)JWSzCACME-specific JWS. Includes none, url, and kid in protected header.N)payloadkeyalgrrrr c s2|dk}tj|||tdddddg||||dS)NrrrZjwkr )rr Zprotectrrr include_jwk)supersign frozenset)clsrrr rrrr!) __class__rrr#1s  zJWS.sign)NN)rrrrrZ signature_clsr rrr classmethodrZJWKZ JWASignaturerrr# __classcell__rr)r&rr,s r)rZtypingrZjosepyr rrrrrrrs