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

Function sign_token_payload

src/orgkernel/crypto_utils.py:196–211  ·  view source on GitHub ↗

Sign ExecutionToken payload with the Org CA private key. Args: private_key_pem: Org CA PKCS8 PEM private key. token_data: Dict of token fields (as passed to ExecutionToken.to_signable_payload()). Returns: Base64url-encoded Ed25519 CA signature.

(
    private_key_pem: str,
    token_data: dict[str, Any],
)

Source from the content-addressed store, hash-verified

194
195
196def sign_token_payload(
197 private_key_pem: str,
198 token_data: dict[str, Any],
199) -> str:
200 """
201 Sign ExecutionToken payload with the Org CA private key.
202
203 Args:
204 private_key_pem: Org CA PKCS8 PEM private key.
205 token_data: Dict of token fields (as passed to ExecutionToken.to_signable_payload()).
206
207 Returns:
208 Base64url-encoded Ed25519 CA signature.
209 """
210 payload = canonical_json(token_data)
211 return sign_payload(private_key_pem, payload)

Callers

nothing calls this directly

Calls 2

canonical_jsonFunction · 0.85
sign_payloadFunction · 0.85

Tested by

no test coverage detected