diff --git a/spec/unit/crypto/secrets.spec.js b/spec/unit/crypto/secrets.spec.js index ca1f04eba..07e0bd48c 100644 --- a/spec/unit/crypto/secrets.spec.js +++ b/spec/unit/crypto/secrets.spec.js @@ -163,7 +163,7 @@ describe("Secrets", function() { }; alice.resetCrossSigningKeys(); - const newKeyId = await alice.addSecretKey( + const newKeyId = await alice.addSecretStorageKey( SECRET_STORAGE_ALGORITHM_V1, ); // we don't await on this because it waits for the event to come down the sync diff --git a/src/client.js b/src/client.js index 8bf93af84..ec1c7f7b9 100644 --- a/src/client.js +++ b/src/client.js @@ -1062,7 +1062,7 @@ MatrixClient.prototype.checkEventSenderTrust = async function(event) { * Add a key for encrypting secrets. * The Secure Secret Storage API is currently UNSTABLE and may change without notice. * - * @function module:client~MatrixClient#addSecretKey + * @function module:client~MatrixClient#addSecretStorageKey * @param {string} algorithm the algorithm used by the key * @param {object} opts the options for the algorithm. The properties used * depend on the algorithm given. This object may be modified to pass @@ -1136,7 +1136,7 @@ MatrixClient.prototype.checkEventSenderTrust = async function(event) { wrapCryptoFuncs(MatrixClient, [ "bootstrapSecretStorage", - "addSecretKey", + "addSecretStorageKey", "storeSecret", "getSecret", "isSecretStored", diff --git a/src/crypto/index.js b/src/crypto/index.js index a3074de2c..41f6098ea 100644 --- a/src/crypto/index.js +++ b/src/crypto/index.js @@ -332,7 +332,8 @@ Crypto.prototype.init = async function() { * called to await a secret storage key creation flow. * Returns: * {Promise} A promise which resolves to key creation data for - * `addSecretKey`: an object with either `passphrase` or `privkey` fields. + * SecretStorage#addKey: an object with either `passphrase` or `privkey` + * fields. */ Crypto.prototype.bootstrapSecretStorage = async function({ authUploadDeviceSigningKeys, @@ -371,7 +372,7 @@ Crypto.prototype.bootstrapSecretStorage = async function({ if (!this._secretStorage.hasKey()) { logger.log("Secret storage default key not found, creating new key"); const keyOptions = await createSecretStorageKey(); - const newKeyId = await this.addSecretKey( + const newKeyId = await this.addSecretStorageKey( SECRET_STORAGE_ALGORITHM_V1, keyOptions, ); @@ -395,7 +396,7 @@ Crypto.prototype.bootstrapSecretStorage = async function({ logger.log("Secure Secret Storage ready"); }; -Crypto.prototype.addSecretKey = function(algorithm, opts, keyID) { +Crypto.prototype.addSecretStorageKey = function(algorithm, opts, keyID) { return this._secretStorage.addKey(algorithm, opts, keyID); };