Lazily initialize the default Org CA Ed25519 keypair (Phase 1 only).
()
| 37 | |
| 38 | |
| 39 | def _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 | |
| 53 | def get_org_ca_public_key_bytes() -> bytes: |
no outgoing calls
no test coverage detected