Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chadgates committed Mar 18, 2024
1 parent e02be38 commit 5dd639f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 11 additions & 6 deletions pyas2lib/as2.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
"""Define the core functions/classes of the pyas2 package."""
import logging
import hashlib
import asyncio
import binascii
import hashlib
import inspect
import logging
import traceback
from dataclasses import dataclass
from email import encoders
from email import message as email_message
from email import message_from_bytes as parse_mime
from email import utils as email_utils
from email.mime.multipart import MIMEMultipart

from oscrypto import asymmetric
import asyncio
import inspect

from pyas2lib.cms import (
compress_message,
Expand Down Expand Up @@ -613,7 +614,9 @@ async def aparse(

if find_org_partner_cb:
if inspect.iscoroutinefunction(find_org_partner_cb):
self.receiver, self.sender = await find_org_partner_cb(org_id, partner_id)
self.receiver, self.sender = await find_org_partner_cb(
org_id, partner_id
)
else:
self.receiver, self.sender = find_org_partner_cb(org_id, partner_id)

Expand Down Expand Up @@ -772,7 +775,9 @@ def parse(self, *args, **kwargs):
"""
loop = asyncio.get_event_loop()
if loop.is_running():
raise RuntimeError("Cannot run synchronous parse within an already running event loop.")
raise RuntimeError(
"Cannot run synchronous parse within an already running event loop."
)
return loop.run_until_complete(self.aparse(*args, **kwargs))


Expand Down
4 changes: 2 additions & 2 deletions pyas2lib/cms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import zlib
from datetime import datetime, timezone

from asn1crypto import cms, core, algos
from asn1crypto import algos, cms, core
from asn1crypto.cms import SMIMECapabilityIdentifier
from oscrypto import asymmetric, symmetric, util

Expand Down Expand Up @@ -73,7 +73,7 @@ def encrypt_message(
:param data_to_encrypt: A byte string of the data to be encrypted
:param enc_alg: The algorithm to be used for encrypting the data
:param encryption_cert: The certificate to be used for encrypting the data
:param key_enc_alg: The encryption scheme for the key encryption: rsaes_pkcs1v15 (default) or rsaes_oaep
:param key_enc_alg: The algo for the key encryption: rsaes_pkcs1v15 (default) or rsaes_oaep
:return: A CMS ASN.1 byte string of the encrypted data.
"""
Expand Down

0 comments on commit 5dd639f

Please sign in to comment.