Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | [scriptable, uuid(2030770e-542e-40cd-8061-cd9d4ad4227f)] |
michael@0 | 9 | |
michael@0 | 10 | interface nsILoginManagerCrypto : nsISupports { |
michael@0 | 11 | |
michael@0 | 12 | const unsigned long ENCTYPE_BASE64 = 0; // obsolete |
michael@0 | 13 | const unsigned long ENCTYPE_SDR = 1; |
michael@0 | 14 | |
michael@0 | 15 | /** |
michael@0 | 16 | * encrypt |
michael@0 | 17 | * |
michael@0 | 18 | * @param plainText |
michael@0 | 19 | * The string to be encrypted. |
michael@0 | 20 | * |
michael@0 | 21 | * Encrypts the specified string, returning the ciphertext value. |
michael@0 | 22 | * |
michael@0 | 23 | * NOTE: The current implemention of this inferface simply uses NSS/PSM's |
michael@0 | 24 | * "Secret Decoder Ring" service. It is not recommended for general |
michael@0 | 25 | * purpose encryption/decryption. |
michael@0 | 26 | * |
michael@0 | 27 | * Can throw if the user cancels entry of their master password. |
michael@0 | 28 | */ |
michael@0 | 29 | AString encrypt(in AString plainText); |
michael@0 | 30 | |
michael@0 | 31 | /** |
michael@0 | 32 | * decrypt |
michael@0 | 33 | * |
michael@0 | 34 | * @param cipherText |
michael@0 | 35 | * The string to be decrypted. |
michael@0 | 36 | * |
michael@0 | 37 | * Decrypts the specified string, returning the plaintext value. |
michael@0 | 38 | * |
michael@0 | 39 | * Can throw if the user cancels entry of their master password, or if the |
michael@0 | 40 | * cipherText value can not be successfully decrypted (eg, if it was |
michael@0 | 41 | * encrypted with some other key). |
michael@0 | 42 | */ |
michael@0 | 43 | AString decrypt(in AString cipherText); |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * uiBusy |
michael@0 | 47 | * |
michael@0 | 48 | * True when a master password prompt is being displayed. |
michael@0 | 49 | */ |
michael@0 | 50 | readonly attribute boolean uiBusy; |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | * isLoggedIn |
michael@0 | 54 | * |
michael@0 | 55 | * Current login state of the token used for encryption. If the user is |
michael@0 | 56 | * not logged in, performing a crypto operation will result in a master |
michael@0 | 57 | * password prompt. |
michael@0 | 58 | */ |
michael@0 | 59 | readonly attribute boolean isLoggedIn; |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * defaultEncType |
michael@0 | 63 | * |
michael@0 | 64 | * Default encryption type used by an implementation of this interface. |
michael@0 | 65 | */ |
michael@0 | 66 | readonly attribute unsigned long defaultEncType; |
michael@0 | 67 | }; |