security/manager/ssl/src/nsSDR.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

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  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef _NSSDR_H_
     8 #define _NSSDR_H_
    10 #include "nsISecretDecoderRing.h"
    12 /**
    13  * NS_SDR_CONTRACTID - contract id for SDR services.
    14  *   Implements nsISecretDecoderRing.
    15  *   Should eventually implement an interface to set window
    16  *   context and other information. (nsISecretDecoderRingConfig)
    17  *
    18  * NOTE: This definition should move to base code.  It
    19  *   is conditionally defined here until it is moved.
    20  *   Delete this after defining in the new location.
    21  */
    22 #ifndef NS_SDR_CONTRACTID
    23 #define NS_SDR_CONTRACTID "@mozilla.org/security/sdr;1"
    24 #endif
    26 // ===============================================
    27 // nsSecretDecoderRing - implementation of nsISecretDecoderRing
    28 // ===============================================
    30 #define NS_SDR_CID \
    31   { 0x0c4f1ddc, 0x1dd2, 0x11b2, { 0x9d, 0x95, 0xf2, 0xfd, 0xf1, 0x13, 0x04, 0x4b } }
    33 class nsSecretDecoderRing
    34 : public nsISecretDecoderRing,
    35   public nsISecretDecoderRingConfig
    36 {
    37 public:
    38   NS_DECL_ISUPPORTS
    39   NS_DECL_NSISECRETDECODERRING
    40   NS_DECL_NSISECRETDECODERRINGCONFIG
    42   nsSecretDecoderRing();
    43   virtual ~nsSecretDecoderRing();
    45 private:
    47   /**
    48    * encode - encodes binary into BASE64 string.
    49    * decode - decode BASE64 string into binary.
    50    */
    51   nsresult encode(const unsigned char *data, int32_t dataLen, char **_retval);
    52   nsresult decode(const char *data, unsigned char **result, int32_t * _retval);
    54 };
    56 #endif /* _NSSDR_H_ */

mercurial