(options: TlsKeyOptions = {})
| 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) |
no outgoing calls
no test coverage detected