Skip to content

common_auth.signing

Local signing from supplied key material; no key files, network or secret sources.

Classes

Signer

Sign exact bytes using supplied material, caching a parsed asymmetric key.

Construction performs no I/O or key parsing. HMAC uses only the standard library; asymmetric algorithms load the optional cryptography package when first used. The signer holds no connection and needs no resource cleanup.

__init__

def __init__(credential: SigningKeyCredential, algorithm: SignatureAlgorithm | str, *, key_id: str | None = None) -> None

Fields and properties declared here; inherited members belong to the bases above.

algorithm

algorithm = SignatureAlgorithm(algorithm)

credential

credential = credential

key_id

key_id = None if key_id is None else TypeAdapter(KeyId).validate_python(key_id)

jwt

def jwt(claims: Mapping[str, object], *, headers: Mapping[str, object] | None = None) -> SignedAssertion

Sign supplied JWT claims, enforcing the JOSE minimum key sizes.

sign

def sign(data: bytes) -> Signature

Sign exactly these bytes; ECDSA returns fixed-width R followed by S.