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

Method getTlsKey

sdk/js/src/index.ts:231–257  ·  view source on GitHub ↗
(options: TlsKeyOptions = {})

Source from the content-addressed store, hash-verified

229 }
230
231 async getTlsKey(options: TlsKeyOptions = {}): Promise<GetTlsKeyResponse> {
232 const {
233 subject = '',
234 altNames = [],
235 usageRaTls = false,
236 usageServerAuth = true,
237 usageClientAuth = false,
238 } = options;
239
240 let raw: Record<string, any> = {
241 subject,
242 usage_ra_tls: usageRaTls,
243 usage_server_auth: usageServerAuth,
244 usage_client_auth: usageClientAuth,
245 }
246 if (altNames && altNames.length) {
247 raw['alt_names'] = altNames
248 }
249 const payload = JSON.stringify(raw)
250 const result = await send_rpc_request<GetTlsKeyResponse>(this.endpoint, '/GetTlsKey', payload)
251 const asUint8Array = (length?: number) => x509key_to_uint8array(result.key, length)
252 return Object.freeze({
253 ...result,
254 asUint8Array,
255 __name__: 'GetTlsKeyResponse',
256 })
257 }
258
259 async getQuote(report_data: string | Buffer | Uint8Array): Promise<GetQuoteResponse> {
260 let hex = to_hex(report_data)

Callers 3

index.test.tsFile · 0.80
viem.test.tsFile · 0.80
solana.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected