nvflare.private.fed.utils.identity_utils module

exception CNMismatch[source]

Bases: Exception

class IdentityAsserter(private_key_file: str, cert_file: str)[source]

Bases: object

sign(content, return_str: bool) str[source]
sign_common_name(nonce: str) str[source]
verify_signature(content, signature) bool[source]
class IdentityVerifier(root_cert_file: str)[source]

Bases: object

verify_common_name(asserted_cn: str, nonce: str, asserter_cert, signature) bool[source]
exception InvalidAsserterCert[source]

Bases: Exception

exception InvalidCNSignature[source]

Bases: Exception

exception MissingCN[source]

Bases: Exception

class TokenVerifier(cert)[source]

Bases: object

verify(client_name, token, signature)[source]
get_cn_from_cert(cert)[source]
get_org_from_cert(cert) str[source]
get_parent_site_name(fqsn: str) str | None[source]

Get the parent site’s name for a specified FQSN (fully qualified site name)

Parameters:

fqsn – the FQSN to find parent for

Returns: the parent site’s name or None if the FQSN doesn’t have a parent

load_cert_bytes(data: bytes)[source]
load_cert_file(path: str)[source]