From 0b19f507d8943e6786a68e7ba7ed8bf17b6cfa7f Mon Sep 17 00:00:00 2001 From: Jacob Gillespie Date: Mon, 30 Oct 2023 13:09:58 +0000 Subject: [PATCH] Update README usage example --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f36834d..f46a210 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,19 @@ const client = createClient() // Connect to a specific endpoint const client = createClient('unix:///path/to/endpoint.sock') + +// Read x509 credentials from Workload API +const rpc = client.fetchX509SVID() +for await (const message of rpc.responses) { + message.svids.forEach((svid) => { + const certificateBase64 = Buffer.from(svid.x509Svid).toString('base64') + console.log('Certificate in Base64 Format:', certificateBase64) + }) + + if (messages.svids.length > 0) { + break + } +} ``` ## License