Skip to content

Commit 5fe1b11

Browse files
committed
chore: organize imports
1 parent edec5e8 commit 5fe1b11

23 files changed

+100
-88
lines changed

src/otdf_python/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
Provides both programmatic APIs and command-line interface for encryption and decryption.
66
"""
77

8+
from .cli import main as cli_main
9+
from .config import KASInfo, NanoTDFConfig, TDFConfig
810
from .sdk import SDK
911
from .sdk_builder import SDKBuilder
10-
from .config import TDFConfig, NanoTDFConfig, KASInfo
11-
from .cli import main as cli_main
1212

1313
__all__ = [
1414
"SDK",

src/otdf_python/aesgcm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
21
import os
32

3+
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
4+
45

56
class AesGcm:
67
GCM_NONCE_LENGTH = 12

src/otdf_python/asym_crypto.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
Asymmetric encryption and decryption utilities for RSA keys in PEM format.
33
"""
44

5-
from cryptography.hazmat.primitives import serialization
6-
from cryptography.hazmat.primitives.asymmetric import rsa, padding
7-
from cryptography.hazmat.primitives import hashes
85
from cryptography.hazmat.backends import default_backend
6+
from cryptography.hazmat.primitives import hashes, serialization
7+
from cryptography.hazmat.primitives.asymmetric import padding, rsa
98
from cryptography.x509 import load_pem_x509_certificate
109

1110
from .sdk_exceptions import SDKException

src/otdf_python/asym_decryption.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
from cryptography.hazmat.primitives import serialization
2-
from cryptography.hazmat.primitives.asymmetric import padding
3-
from cryptography.hazmat.primitives import hashes
4-
from cryptography.hazmat.backends import default_backend
51
import base64
62

3+
from cryptography.hazmat.backends import default_backend
4+
from cryptography.hazmat.primitives import hashes, serialization
5+
from cryptography.hazmat.primitives.asymmetric import padding
6+
77
from .sdk_exceptions import SDKException
88

99

src/otdf_python/asym_encryption.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from cryptography.hazmat.primitives import serialization
2-
from cryptography.hazmat.primitives.asymmetric import padding
3-
from cryptography.hazmat.primitives import hashes
4-
from cryptography.x509 import load_pem_x509_certificate
5-
from cryptography.hazmat.backends import default_backend
61
import base64
72
import re
83

4+
from cryptography.hazmat.backends import default_backend
5+
from cryptography.hazmat.primitives import hashes, serialization
6+
from cryptography.hazmat.primitives.asymmetric import padding
7+
from cryptography.x509 import load_pem_x509_certificate
8+
99
from .sdk_exceptions import SDKException
1010

1111

src/otdf_python/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import json
1212
import logging
1313
import sys
14+
from dataclasses import asdict
1415
from io import BytesIO
1516
from pathlib import Path
16-
from dataclasses import asdict
1717

1818
from otdf_python.config import KASInfo, NanoTDFConfig, TDFConfig
1919
from otdf_python.sdk import SDK

src/otdf_python/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from dataclasses import dataclass, field
22
from enum import Enum
3-
from urllib.parse import urlparse, urlunparse
43
from typing import Any
4+
from urllib.parse import urlparse, urlunparse
55

66

77
class TDFFormat(Enum):

src/otdf_python/crypto_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import hmac
21
import hashlib
3-
from cryptography.hazmat.primitives.asymmetric import rsa, ec
4-
from cryptography.hazmat.primitives import serialization
2+
import hmac
3+
54
from cryptography.hazmat.backends import default_backend
5+
from cryptography.hazmat.primitives import serialization
6+
from cryptography.hazmat.primitives.asymmetric import ec, rsa
67

78

89
class CryptoUtils:

src/otdf_python/dpop.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
DPoP (Demonstration of Proof-of-Possession) token generation utilities.
33
"""
44

5-
import time
6-
import hashlib
75
import base64
6+
import hashlib
7+
import time
8+
89
import jwt
910

1011
from .crypto_utils import CryptoUtils

src/otdf_python/eckeypair.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1+
from cryptography.exceptions import InvalidSignature
2+
from cryptography.hazmat.backends import default_backend
3+
from cryptography.hazmat.primitives import hashes, serialization
14
from cryptography.hazmat.primitives.asymmetric import ec
2-
from cryptography.hazmat.primitives import serialization, hashes
35
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
46
from cryptography.hazmat.primitives.serialization import (
57
Encoding,
6-
PublicFormat,
7-
PrivateFormat,
88
NoEncryption,
9+
PrivateFormat,
10+
PublicFormat,
911
)
10-
from cryptography.hazmat.backends import default_backend
11-
from cryptography.exceptions import InvalidSignature
1212

1313

1414
class ECKeyPair:

0 commit comments

Comments
 (0)