Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 /**
9 * Buffer type - for storing 8-bit octet values.
10 */
11 [ptr] native buffer(unsigned char);
13 [scriptable, uuid(0EC80360-075C-11d4-9FD4-00C04F1B83D8)]
14 interface nsISecretDecoderRing: nsISupports {
16 /**
17 * Encrypt a buffer - callable only from C++.
18 *
19 * @return The length of the data in the output buffer.
20 */
21 [noscript] long encrypt(in buffer data, in long dataLen, out buffer result);
23 /**
24 * Decrypt a buffer - callable only from C++.
25 *
26 * @return The length of the data in the output buffer.
27 */
28 [noscript] long decrypt(in buffer data, in long dataLen, out buffer result);
30 /**
31 * Encrypt nul-terminated string to BASE64 output.
32 */
33 string encryptString(in string text);
35 /**
36 * Decrypt BASE64 input to nul-terminated string output. There is
37 * no check for embedded nul values in the decrypted output.
38 */
39 string decryptString(in string crypt);
41 /**
42 * Prompt the user to change the password on the SDR key.
43 */
44 void changePassword();
46 /**
47 * Logout of the security device that protects the SDR key.
48 */
49 void logout();
51 /**
52 * Logout of the security device that protects the SDR key and tear
53 * down authenticated objects.
54 */
55 void logoutAndTeardown();
56 };
58 /**
59 * Configuration interface for the Secret Decoder Ring
60 * - this interface allows setting the window that will be
61 * used as parent for dialog windows (such as password prompts)
62 */
63 [scriptable, uuid(01D8C0F0-0CCC-11d4-9FDD-000064657374)]
64 interface nsISecretDecoderRingConfig: nsISupports {
65 void setWindow(in nsISupports w);
66 };