(path: string, purpose: string = '', algorithm: string = 'secp256k1')
| 214 | } |
| 215 | |
| 216 | async getKey(path: string, purpose: string = '', algorithm: string = 'secp256k1'): Promise<GetKeyResponse> { |
| 217 | await this.ensureAlgorithmSupported(algorithm) |
| 218 | const payload = JSON.stringify({ |
| 219 | path: path, |
| 220 | purpose: purpose, |
| 221 | algorithm: algorithm |
| 222 | }) |
| 223 | const result = await send_rpc_request<{ key: string, signature_chain: string[] }>(this.endpoint, '/GetKey', payload) |
| 224 | return Object.freeze({ |
| 225 | key: new Uint8Array(Buffer.from(result.key, 'hex')), |
| 226 | signature_chain: result.signature_chain.map(sig => new Uint8Array(Buffer.from(sig, 'hex'))), |
| 227 | __name__: 'GetKeyResponse', |
| 228 | }) |
| 229 | } |
| 230 | |
| 231 | async getTlsKey(options: TlsKeyOptions = {}): Promise<GetTlsKeyResponse> { |
| 232 | const { |
no test coverage detected