From 14a2d7e8602917e28171fad008497c78643e4a14 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 6 Dec 2019 13:20:57 +0000 Subject: [PATCH] Add docs for more exported cross-signing APIs --- src/client.js | 20 ++++++++++++++++++++ src/crypto/index.js | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index c720b1db0..52a28d2c5 100644 --- a/src/client.js +++ b/src/client.js @@ -1018,6 +1018,26 @@ function wrapCryptoFuncs(MatrixClient, names) { * @returns {DeviceTrustLevel} */ +/** + * Check the copy of our cross-signing key that we have in the device list and + * see if we can get the private key. If so, mark it as trusted. + * The cross-signing API is currently UNSTABLE and may change without notice. + * + * @function module:client~MatrixClient#checkOwnCrossSigningTrust + */ + +/** + * Checks that a given private key matches a given public key + * This can be used by the getCrossSigningKey callback to verify that the + * private key it is about to supply is the one that was requested. + * The cross-signing API is currently UNSTABLE and may change without notice. + * + * @function module:client~MatrixClient#checkPrivateKey + * @param {Uint8Array} privateKey The private key + * @param {Uint8Array} expectedPublicKey The public key supplied by the getCrossSigningKey callback + * @returns {boolean} true if the key matches, otherwise false + */ + wrapCryptoFuncs(MatrixClient, [ "resetCrossSigningKeys", "getCrossSigningId", diff --git a/src/crypto/index.js b/src/crypto/index.js index 3df51c3ba..e4e42fae1 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -775,7 +775,7 @@ Crypto.prototype._onDeviceListUserCrossSigningUpdated = async function(userId) { } }; -/* +/** * Check the copy of our cross-signing key that we have in the device list and * see if we can get the private key. If so, mark it as trusted. */