X7ROOT File Manager
Current Path:
/usr/lib/python2.7/site-packages/acme
usr
/
lib
/
python2.7
/
site-packages
/
acme
/
📁
..
📄
__init__.py
(972 B)
📄
__init__.pyc
(803 B)
📄
__init__.pyo
(803 B)
📄
challenges.py
(19.18 KB)
📄
challenges.pyc
(21.37 KB)
📄
challenges.pyo
(21.37 KB)
📄
client.py
(45.86 KB)
📄
client.pyc
(42.52 KB)
📄
client.pyo
(42.32 KB)
📄
crypto_util.py
(12.2 KB)
📄
crypto_util.pyc
(12.39 KB)
📄
crypto_util.pyo
(12.3 KB)
📄
errors.py
(4.15 KB)
📄
errors.pyc
(6.75 KB)
📄
errors.pyo
(6.75 KB)
📄
fields.py
(1.7 KB)
📄
fields.pyc
(2.93 KB)
📄
fields.pyo
(2.93 KB)
📄
jws.py
(2.05 KB)
📄
jws.pyc
(2.35 KB)
📄
jws.pyo
(2.35 KB)
📄
magic_typing.py
(537 B)
📄
magic_typing.pyc
(871 B)
📄
magic_typing.pyo
(871 B)
📄
messages.py
(23.27 KB)
📄
messages.pyc
(30.11 KB)
📄
messages.pyo
(30.07 KB)
📄
mixins.py
(2.65 KB)
📄
mixins.pyc
(3.29 KB)
📄
mixins.pyo
(3.29 KB)
📄
standalone.py
(10.88 KB)
📄
standalone.pyc
(11.9 KB)
📄
standalone.pyo
(11.9 KB)
📄
util.py
(160 B)
📄
util.pyc
(620 B)
📄
util.pyo
(620 B)
Editing: jws.py
"""ACME-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. """ import josepy as jose class Header(jose.Header): """ACME-specific JOSE Header. Implements nonce, kid, and url. """ nonce = jose.Field('nonce', omitempty=True, encoder=jose.encode_b64jose) kid = jose.Field('kid', omitempty=True) url = jose.Field('url', omitempty=True) @nonce.decoder def nonce(value): # pylint: disable=no-self-argument,missing-function-docstring try: return jose.decode_b64jose(value) except jose.DeserializationError as error: # TODO: custom error raise jose.DeserializationError("Invalid nonce: {0}".format(error)) class Signature(jose.Signature): """ACME-specific Signature. Uses ACME-specific Header for customer fields.""" __slots__ = jose.Signature._orig_slots # pylint: disable=no-member # TODO: decoder/encoder should accept cls? Otherwise, subclassing # JSONObjectWithFields is tricky... header_cls = Header header = jose.Field( 'header', omitempty=True, default=header_cls(), decoder=header_cls.from_json) # TODO: decoder should check that nonce is in the protected header class JWS(jose.JWS): """ACME-specific JWS. Includes none, url, and kid in protected header.""" signature_cls = Signature __slots__ = jose.JWS._orig_slots @classmethod # pylint: disable=arguments-differ def sign(cls, payload, key, alg, nonce, url=None, kid=None): # Per ACME spec, jwk and kid are mutually exclusive, so only include a # jwk field if kid is not provided. include_jwk = kid is None return super(JWS, cls).sign(payload, key=key, alg=alg, protect=frozenset(['nonce', 'url', 'kid', 'jwk', 'alg']), nonce=nonce, url=url, kid=kid, include_jwk=include_jwk)
Upload File
Create Folder