netwerk/base/public/nsISecretDecoderRing.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsISecretDecoderRing.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +/**
    1.12 + * Buffer type - for storing 8-bit octet values.
    1.13 + */
    1.14 +[ptr] native buffer(unsigned char);
    1.15 +
    1.16 +[scriptable, uuid(0EC80360-075C-11d4-9FD4-00C04F1B83D8)]
    1.17 +interface nsISecretDecoderRing: nsISupports {
    1.18 +
    1.19 +  /**
    1.20 +   * Encrypt a buffer - callable only from C++.
    1.21 +   *
    1.22 +   * @return The length of the data in the output buffer.
    1.23 +   */
    1.24 +  [noscript] long encrypt(in buffer data, in long dataLen, out buffer result);
    1.25 +
    1.26 +  /**
    1.27 +   * Decrypt a buffer - callable only from C++.
    1.28 +   *
    1.29 +   * @return The length of the data in the output buffer.
    1.30 +   */
    1.31 +  [noscript] long decrypt(in buffer data, in long dataLen, out buffer result);
    1.32 +
    1.33 +  /**
    1.34 +   * Encrypt nul-terminated string to BASE64 output.
    1.35 +   */
    1.36 +  string encryptString(in string text);
    1.37 +
    1.38 +  /**
    1.39 +   * Decrypt BASE64 input to nul-terminated string output.  There is
    1.40 +   * no check for embedded nul values in the decrypted output.
    1.41 +   */
    1.42 +  string decryptString(in string crypt);
    1.43 +
    1.44 +  /**
    1.45 +   * Prompt the user to change the password on the SDR key.
    1.46 +   */
    1.47 +  void changePassword();
    1.48 +
    1.49 +  /**
    1.50 +   * Logout of the security device that protects the SDR key.
    1.51 +   */
    1.52 +  void logout();
    1.53 +
    1.54 +  /**
    1.55 +   * Logout of the security device that protects the SDR key and tear
    1.56 +   * down authenticated objects.
    1.57 +   */
    1.58 +  void logoutAndTeardown();
    1.59 +};
    1.60 +
    1.61 +/**
    1.62 + * Configuration interface for the Secret Decoder Ring
    1.63 + *  - this interface allows setting the window that will be
    1.64 + *    used as parent for dialog windows (such as password prompts)
    1.65 + */
    1.66 +[scriptable, uuid(01D8C0F0-0CCC-11d4-9FDD-000064657374)]
    1.67 +interface nsISecretDecoderRingConfig: nsISupports {
    1.68 +  void setWindow(in nsISupports w);
    1.69 +};

mercurial