jose.* imports cleanup

This commit is contained in:
Jakub Warmuz 2015-03-18 22:07:37 +00:00
parent ef72b147ae
commit 77eb5f7625
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA
3 changed files with 6 additions and 12 deletions

View file

@ -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

View file

@ -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'))

View file

@ -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):