toolkit/components/passwordmgr/nsILoginManagerCrypto.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/passwordmgr/nsILoginManagerCrypto.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,67 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +[scriptable, uuid(2030770e-542e-40cd-8061-cd9d4ad4227f)]
    1.12 +
    1.13 +interface nsILoginManagerCrypto : nsISupports {
    1.14 +
    1.15 +    const unsigned long ENCTYPE_BASE64 = 0; // obsolete
    1.16 +    const unsigned long ENCTYPE_SDR = 1;
    1.17 +
    1.18 +    /**
    1.19 +     * encrypt
    1.20 +     *
    1.21 +     * @param plainText
    1.22 +     *        The string to be encrypted.
    1.23 +     *
    1.24 +     * Encrypts the specified string, returning the ciphertext value.
    1.25 +     *
    1.26 +     * NOTE: The current implemention of this inferface simply uses NSS/PSM's
    1.27 +     * "Secret Decoder Ring" service. It is not recommended for general
    1.28 +     * purpose encryption/decryption.
    1.29 +     *
    1.30 +     * Can throw if the user cancels entry of their master password.
    1.31 +     */
    1.32 +    AString encrypt(in AString plainText);
    1.33 +
    1.34 +    /**
    1.35 +     * decrypt
    1.36 +     *
    1.37 +     * @param cipherText
    1.38 +     *        The string to be decrypted.
    1.39 +     *
    1.40 +     * Decrypts the specified string, returning the plaintext value.
    1.41 +     *
    1.42 +     * Can throw if the user cancels entry of their master password, or if the
    1.43 +     * cipherText value can not be successfully decrypted (eg, if it was
    1.44 +     * encrypted with some other key).
    1.45 +     */
    1.46 +    AString decrypt(in AString cipherText);
    1.47 +
    1.48 +    /**
    1.49 +     * uiBusy
    1.50 +     *
    1.51 +     * True when a master password prompt is being displayed.
    1.52 +     */
    1.53 +    readonly attribute boolean uiBusy;
    1.54 +
    1.55 +    /**
    1.56 +     * isLoggedIn
    1.57 +     *
    1.58 +     * Current login state of the token used for encryption. If the user is
    1.59 +     * not logged in, performing a crypto operation will result in a master
    1.60 +     * password prompt.
    1.61 +     */
    1.62 +    readonly attribute boolean isLoggedIn;
    1.63 +
    1.64 +    /**
    1.65 +     * defaultEncType
    1.66 +     *
    1.67 +     * Default encryption type used by an implementation of this interface.
    1.68 +     */
    1.69 +    readonly attribute unsigned long defaultEncType;
    1.70 +};

mercurial