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

Method deriveKey

sdk/js/src/index.ts:466–480  ·  view source on GitHub ↗

* @deprecated Use getKey instead. * @param path The path to the key. * @param subject The subject of the key. * @param altNames The alternative names of the key. * @returns The key.

(path?: string, subject?: string, alt_names?: string[])

Source from the content-addressed store, hash-verified

464 * @returns The key.
465 */
466 async deriveKey(path?: string, subject?: string, alt_names?: string[]): Promise<GetTlsKeyResponse> {
467 console.warn('deriveKey is deprecated, please use getKey instead');
468 let raw: Record<string, any> = { path: path || '', subject: subject || path || '' }
469 if (alt_names && alt_names.length) {
470 raw['alt_names'] = alt_names
471 }
472 const payload = JSON.stringify(raw)
473 const result = await send_rpc_request<GetTlsKeyResponse>(this.endpoint, '/prpc/Tappd.DeriveKey', payload)
474 const asUint8Array = (length?: number) => x509key_to_uint8array(result.key, length)
475 return Object.freeze({
476 ...result,
477 asUint8Array,
478 __name__: 'GetTlsKeyResponse',
479 })
480 }
481
482 /**
483 * @deprecated Use getQuote instead.

Callers 3

index.test.tsFile · 0.45
viem.test.tsFile · 0.45
solana.test.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected