From 794f044dda21cfe6d5b1075a0aca868e857e3ce0 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 4 Nov 2024 10:53:30 +0000 Subject: [PATCH] Make doc clearer on getCrossSigningKeyId (#4477) * Make doc clearer on getCrossSigningKeyId I was trying to work out why this was being used in a check. It turns out it only returns the key ID if the private part is stored locally, which seems very much non-obvious. * Better doc * Formatting & clarity Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --------- Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- src/crypto-api/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crypto-api/index.ts b/src/crypto-api/index.ts index ea6177f7f85..46fe7528a0a 100644 --- a/src/crypto-api/index.ts +++ b/src/crypto-api/index.ts @@ -274,7 +274,13 @@ export interface CryptoApi { isCrossSigningReady(): Promise; /** - * Get the ID of one of the user's cross-signing keys. + * Get the ID of one of the user's cross-signing keys, if both private and matching + * public parts of that key are available (ie. cached in the local crypto store). + * + * The public part may not be available if a `/keys/query` request has not yet been + * performed, or if the device that created the keys failed to publish them. + * + * If either part of the keypair is not available, this will return `null`. * * @param type - The type of key to get the ID of. One of `CrossSigningKey.Master`, `CrossSigningKey.SelfSigning`, * or `CrossSigningKey.UserSigning`. Defaults to `CrossSigningKey.Master`.