MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / get_tls_key

Method get_tls_key

sdk/python/src/dstack_sdk/dstack_client.py:464–483  ·  view source on GitHub ↗

Request a TLS key from the service with optional parameters.

(
        self,
        subject: str | None = None,
        alt_names: List[str] | None = None,
        usage_ra_tls: bool = False,
        usage_server_auth: bool = True,
        usage_client_auth: bool = False,
    )

Source from the content-addressed store, hash-verified

462 return None
463
464 async def get_tls_key(
465 self,
466 subject: str | None = None,
467 alt_names: List[str] | None = None,
468 usage_ra_tls: bool = False,
469 usage_server_auth: bool = True,
470 usage_client_auth: bool = False,
471 ) -> GetTlsKeyResponse:
472 """Request a TLS key from the service with optional parameters."""
473 data: Dict[str, Any] = {
474 "subject": subject or "",
475 "usage_ra_tls": usage_ra_tls,
476 "usage_server_auth": usage_server_auth,
477 "usage_client_auth": usage_client_auth,
478 }
479 if alt_names:
480 data["alt_names"] = list(alt_names)
481
482 result = await self._send_rpc_request("GetTlsKey", data)
483 return GetTlsKeyResponse(**result)
484
485 async def sign(self, algorithm: str, data: str | bytes) -> SignResponse:
486 """Signs data using a derived key."""

Callers 3

test_tls_key_uniquenessFunction · 0.95
test_async_client_typesFunction · 0.95

Calls 3

_send_rpc_requestMethod · 0.95
listFunction · 0.85
GetTlsKeyResponseClass · 0.70

Tested by 3

test_tls_key_uniquenessFunction · 0.76
test_async_client_typesFunction · 0.76