Files
firefox/security/manager/ssl/nsISecretDecoderRing.idl
T
Cykesiopka 55598f3c05 Bug 1366584 - Add initial [must_use] properties to PSM IDL files. r=keeler
The [must_use] property on XPIDL methods and attributes is useful for making
sure errors are properly handled.

As a first step, this patch adds the property to PSM methods and attributes that
are already correctly checked everywhere.

MozReview-Commit-ID: KyGxwUK3x0X
2017-05-25 21:56:04 +08:00

55 lines
1.7 KiB
Plaintext

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
[scriptable, uuid(0EC80360-075C-11d4-9FD4-00C04F1B83D8)]
interface nsISecretDecoderRing: nsISupports {
/**
* Encrypt to Base64 output.
* Note that the input must basically be a byte array (i.e. the code points
* must be within the range [0, 255]). Hence, using this method directly to
* encrypt passwords (or any text, really) won't work as expected.
* Instead, use something like nsIScriptableUnicodeConverter to first convert
* the desired password or text to UTF-8, then encrypt that. Remember to
* convert back when calling decryptString().
*
* @param text The text to encrypt.
* @return The encrypted text, encoded as Base64.
*/
[must_use]
ACString encryptString(in ACString text);
/**
* Decrypt Base64 input.
* See the encryptString() documentation - this method has basically the same
* limitations.
*
* @param encryptedBase64Text Encrypted input text, encoded as Base64.
* @return The decoded text.
*/
[must_use]
ACString decryptString(in ACString encryptedBase64Text);
/**
* Prompt the user to change the password on the SDR key.
*/
[must_use]
void changePassword();
/**
* Logout of the security device that protects the SDR key.
*/
[must_use]
void logout();
/**
* Logout of the security device that protects the SDR key and tear
* down authenticated objects.
*/
[must_use]
void logoutAndTeardown();
};