MCPcopy
hub / github.com/MetapriseAI/OrgKernel / _ensure_ca_keypair

Function _ensure_ca_keypair

src/orgkernel/crypto_utils.py:39–50  ·  view source on GitHub ↗

Lazily initialize the default Org CA Ed25519 keypair (Phase 1 only).

()

Source from the content-addressed store, hash-verified

37
38
39def _ensure_ca_keypair() -> tuple[ed25519.Ed25519PrivateKey, bytes]:
40 """Lazily initialize the default Org CA Ed25519 keypair (Phase 1 only)."""
41 global _DEFAULT_ORG_CA_PRIVATE_KEY, _DEFAULT_ORG_CA_PUBLIC_KEY_BYTES
42 if _DEFAULT_ORG_CA_PRIVATE_KEY is None:
43 _DEFAULT_ORG_CA_PRIVATE_KEY = ed25519.Ed25519PrivateKey.generate()
44 _DEFAULT_ORG_CA_PUBLIC_KEY_BYTES = (
45 _DEFAULT_ORG_CA_PRIVATE_KEY.public_key().public_bytes(
46 encoding=serialization.Encoding.Raw,
47 format=serialization.PublicFormat.Raw,
48 )
49 )
50 return _DEFAULT_ORG_CA_PRIVATE_KEY, _DEFAULT_ORG_CA_PUBLIC_KEY_BYTES
51
52
53def get_org_ca_public_key_bytes() -> bytes:

Callers 5

get_certificateFunction · 0.90
mintMethod · 0.90
_get_ca_keypairFunction · 0.90
compute_ca_fingerprintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected