mirror of
https://github.com/certbot/certbot.git
synced 2026-06-06 23:32:06 -04:00
jose.* imports cleanup
This commit is contained in:
parent
ef72b147ae
commit
77eb5f7625
3 changed files with 6 additions and 12 deletions
|
|
@ -7,9 +7,6 @@ from letsencrypt.acme import jose
|
|||
from letsencrypt.acme import other
|
||||
from letsencrypt.acme import util
|
||||
|
||||
from letsencrypt.acme.jose import errors as jose_errors
|
||||
from letsencrypt.acme.jose import json_util
|
||||
|
||||
|
||||
class Message(jose.TypedJSONObjectWithFields):
|
||||
# _fields_to_json | pylint: disable=abstract-method
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ from letsencrypt.acme import errors
|
|||
from letsencrypt.acme import jose
|
||||
from letsencrypt.acme import other
|
||||
|
||||
from letsencrypt.acme.jose import errors as jose_errors
|
||||
|
||||
|
||||
KEY = Crypto.PublicKey.RSA.importKey(pkg_resources.resource_string(
|
||||
'letsencrypt.client.tests', 'testdata/rsa256_key.pem'))
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import Crypto.Random
|
|||
import Crypto.PublicKey.RSA
|
||||
|
||||
from letsencrypt.acme import jose
|
||||
from letsencrypt.acme.jose import json_util
|
||||
|
||||
|
||||
class Signature(jose.JSONObjectWithFields):
|
||||
|
|
@ -23,13 +22,13 @@ class Signature(jose.JSONObjectWithFields):
|
|||
NONCE_SIZE = 16
|
||||
"""Minimum size of nonce in bytes."""
|
||||
|
||||
alg = json_util.Field('alg', decoder=jose.JWASignature.from_json)
|
||||
sig = json_util.Field('sig', encoder=jose.b64encode,
|
||||
decoder=json_util.decode_b64jose)
|
||||
nonce = json_util.Field(
|
||||
alg = jose.Field('alg', decoder=jose.JWASignature.from_json)
|
||||
sig = jose.Field('sig', encoder=jose.b64encode,
|
||||
decoder=jose.decode_b64jose)
|
||||
nonce = jose.Field(
|
||||
'nonce', encoder=jose.b64encode, decoder=functools.partial(
|
||||
json_util.decode_b64jose, size=NONCE_SIZE, minimum=True))
|
||||
jwk = json_util.Field('jwk', decoder=jose.JWK.from_json)
|
||||
jose.decode_b64jose, size=NONCE_SIZE, minimum=True))
|
||||
jwk = jose.Field('jwk', decoder=jose.JWK.from_json)
|
||||
|
||||
@classmethod
|
||||
def from_msg(cls, msg, key, nonce=None, nonce_size=None, alg=jose.RS256):
|
||||
|
|
|
|||
Loading…
Reference in a new issue