-
-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make doc clearer on getCrossSigningKeyId #4477
Conversation
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.
src/crypto-api/index.ts
Outdated
* Get the ID of one of the user's cross-signing keys, if the private is available. | ||
* If the private key is not available, this will return null. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing "key", but it might be good to be more explicit about what "is available" means. Does "in 4S" count as "available"? (I think not?)
This is already touched on in the @returns
tag, but I don't think "cross-signing has been initialised" is very clear either. It would be good to clarify that while you're here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, looks like it depends what hasMaster
etc. mean on olmMachine.crossSigningStatus
. Do you have any idea without me delving into the rust?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://matrix-org.github.io/matrix-rust-sdk/matrix_sdk_crypto/olm/struct.CrossSigningStatus.html might be vaguely helpful.
It means "cached in the local crypto store"; ie the private key has been loaded from 4S or similar.
I also note that this will return null if we have the private key but not the public key (which can happen if we haven't yet done a /keys/query, or if the device that created the keys failed to publish them), or if the public and private keys don't match. We should probably say that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - hopefully better now.
Co-authored-by: Richard van der Hoff <[email protected]>
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.
Checklist
public
/exported
symbols have accurate TSDoc documentation.