michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * Buffer type - for storing 8-bit octet values. michael@0: */ michael@0: [ptr] native buffer(unsigned char); michael@0: michael@0: [scriptable, uuid(0EC80360-075C-11d4-9FD4-00C04F1B83D8)] michael@0: interface nsISecretDecoderRing: nsISupports { michael@0: michael@0: /** michael@0: * Encrypt a buffer - callable only from C++. michael@0: * michael@0: * @return The length of the data in the output buffer. michael@0: */ michael@0: [noscript] long encrypt(in buffer data, in long dataLen, out buffer result); michael@0: michael@0: /** michael@0: * Decrypt a buffer - callable only from C++. michael@0: * michael@0: * @return The length of the data in the output buffer. michael@0: */ michael@0: [noscript] long decrypt(in buffer data, in long dataLen, out buffer result); michael@0: michael@0: /** michael@0: * Encrypt nul-terminated string to BASE64 output. michael@0: */ michael@0: string encryptString(in string text); michael@0: michael@0: /** michael@0: * Decrypt BASE64 input to nul-terminated string output. There is michael@0: * no check for embedded nul values in the decrypted output. michael@0: */ michael@0: string decryptString(in string crypt); michael@0: michael@0: /** michael@0: * Prompt the user to change the password on the SDR key. michael@0: */ michael@0: void changePassword(); michael@0: michael@0: /** michael@0: * Logout of the security device that protects the SDR key. michael@0: */ michael@0: void logout(); michael@0: michael@0: /** michael@0: * Logout of the security device that protects the SDR key and tear michael@0: * down authenticated objects. michael@0: */ michael@0: void logoutAndTeardown(); michael@0: }; michael@0: michael@0: /** michael@0: * Configuration interface for the Secret Decoder Ring michael@0: * - this interface allows setting the window that will be michael@0: * used as parent for dialog windows (such as password prompts) michael@0: */ michael@0: [scriptable, uuid(01D8C0F0-0CCC-11d4-9FDD-000064657374)] michael@0: interface nsISecretDecoderRingConfig: nsISupports { michael@0: void setWindow(in nsISupports w); michael@0: };