|
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/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 /** |
|
9 * Buffer type - for storing 8-bit octet values. |
|
10 */ |
|
11 [ptr] native buffer(unsigned char); |
|
12 |
|
13 [scriptable, uuid(0EC80360-075C-11d4-9FD4-00C04F1B83D8)] |
|
14 interface nsISecretDecoderRing: nsISupports { |
|
15 |
|
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); |
|
22 |
|
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); |
|
29 |
|
30 /** |
|
31 * Encrypt nul-terminated string to BASE64 output. |
|
32 */ |
|
33 string encryptString(in string text); |
|
34 |
|
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); |
|
40 |
|
41 /** |
|
42 * Prompt the user to change the password on the SDR key. |
|
43 */ |
|
44 void changePassword(); |
|
45 |
|
46 /** |
|
47 * Logout of the security device that protects the SDR key. |
|
48 */ |
|
49 void logout(); |
|
50 |
|
51 /** |
|
52 * Logout of the security device that protects the SDR key and tear |
|
53 * down authenticated objects. |
|
54 */ |
|
55 void logoutAndTeardown(); |
|
56 }; |
|
57 |
|
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 }; |